gpt4 book ai didi

c# - 从两列结果集创建图表

转载 作者:行者123 更新时间:2023-11-29 12:05:19 25 4
gpt4 key购买 nike

我需要创建一个 SQL 查询来分析 atendimetos 员工

我的目标是通过此查询并创建一个图表,显示调用的总分钟数:120 分钟(非常服务时间)有多少分钟以及有多少次低于 120 分钟(正常通话)在 C# 图表中使用

最简单的方法是生成两列,对吗?

我怎样才能做到这一点?我想不出解决办法。

SELECT SUM(CallDuration)
FROM CallsFromCustomers
WHERE DATE(CallDate) Between'2015-06-01' And '2015-06-31'
AND CallDuration < 120
UNION
SELECT
SUM(CallDuration)
FROM CallsFromCustomers
WHERE DATE(CallDate) Between '2015-06-01' And '2015-06-31'
AND CallDuration >= 120

结果

SUM(CallDuration)|
5584 |
759 |

最佳答案

SELECT 
(SELECT COUNT(*)
FROM CallsFromCustomers
WHERE DATE(CallDate) Between'2015-06-01' And '2015-06-31'
AND CallDuration < 120) AS ShortCalls,
(SELECT COUNT(*)
FROM CallsFromCustomers
WHERE DATE(CallDate) Between '2015-06-01' And '2015-06-31'
AND CallDuration >= 120) AS LongCalls

关于c# - 从两列结果集创建图表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31586757/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com