标签:
SELECT SUM(CASE WHEN STATE=1 THEN 1 ELSE 0 END) ,SUM(CASE WHEN STATE=2 THEN 1 ELSE 0 END) ,SUM(CASE WHEN STATE=3 THEN 1 ELSE 0 END) ,SUM(CASE WHEN STATE=4 THEN 1 ELSE 0 END) FROM TB
带条件Count
原文地址:http://www.cnblogs.com/shiningrise/p/5612929.html