正在悠闲地加载

并列统计CASE WHEN

 

select sum(case when depart = 'Physical' then 1 else 0 end) PhyTotal,
 sum(case when depart = 'Chemistry' then 1 else 0 end) CheTotal,
sum(case when depart = 'Math' then 1 else 0 end ) MathTotal
from student 

 

posted @ 2015-04-27 12:08  仰望星空的耕田人  阅读(504)  评论(0编辑  收藏  举报