【发布时间】:2018-04-20 07:57:16
【问题描述】:
我无法为下表内容派生 SQL 查询。
当我尝试以下查询时,我得到了上述输出。有人可以帮我提供所需的查询吗?
select Name, count(Status) from mytable where Status='Open' group by mytable union
select Name, count(Status) from mytable where Status='Cleared' group by mytable
【问题讨论】:
-
在选择列表中使用 case 表达式进行条件聚合。