有一个表
查询结果为
用下面的代码写
select COUNT( case NumName when 'a' then NumName end ) as 'aaa', COUNT( case NumName when 'b' then NumName end ) as 'bb', COUNT( case NumName when 'c' then NumName end) as 'cc' from dbo.DataTb
有一个表
查询结果为
用下面的代码写
select COUNT( case NumName when 'a' then NumName end ) as 'aaa', COUNT( case NumName when 'b' then NumName end ) as 'bb', COUNT( case NumName when 'c' then NumName end) as 'cc' from dbo.DataTb