【发布时间】:2019-09-24 14:48:01
【问题描述】:
我正在寻找一个查询,它将返回表中的每个地区值以及给定时间段内每个不同值的计数
我目前正在使用以下查询
Select count(distinct account_type)
From Table_1
Where date between '2019-08-01' and '2019-08-31' and
account_type = '0' and
account_type = '1' and
account_type = '2' and
account_type = '3' and
account_type = '4'
我要找的结果集如下
account_type Count
0 123
1 456
2 789
3 101112
4 131415
我得到的结果集是
account_type
0
【问题讨论】: