有如下表T_CUST
CUST_NO  CUST_TYPE
1        1
2        A
3        M
4        C
5        A
6        M
7        3
其中,CUST_NO为客户编号,CUST_TYPE为客户类型,1、A表示全球通,3、C表示神州行,M表示动感地带,要求写出一条SQL语句得出如下结果:
客户类型     人数统计
全球通       3
神州行       2
动感地带     2我自己写的一条SQL语句也能达到结果,但是感觉效率不行,因为数据量很大,求高手给出效率高点的SQL语句,下面是我自己写的
select '神州行'as 品牌,count(*) as 总数 from t_cust where cust_type in('1','A') 
union select 'abc',count(*) from t_cust where cust_type in('3','C')
union select '动感地带',count(*) from t_cust where cust_type = 'M';