22,294
社区成员
发帖
与我相关
我的任务
分享
SELECT A.aa,B.bb FROM
(select count(*) as aa from 表A where A=1 and B=100)A
,(select count(*) as bb from 表A where A=1 and B=100 and C <>'')B
select sum(case when A=1 and B=100 then 1 else 0 end ) as aa
,sum(case A=1 and B=100 and C <>'' then 1 else 0 end ) as bb
from 表Aselect count(*) as aa,sum(case when C <>'' then 1 else 0 end) as bb from 表A where A=1 and B=100select count(*) as aa,sum(case when C <>' then 1 else 0 end) as bb from 表A where A=1 and B=100 select aa=(select count(*)from 表A where A=1 and B=100 ),
bb=(select count(*) as bb from 表A where A=1 and B=100 and C <>'')