Loading

SQL集合函数中使用case when then

SELECT sex,
COUNT(Case province when '广东省'  then '广东省' end) as '广东省',
COUNT(Case province when '江西省' then '江西省' end) as '江西省',  
COUNT(Case province when '浙江省' then '浙江省' end) as '浙江省'
From Case_Test2 group by sex

 

 

posted @ 2012-05-05 02:38  The Mechanic  阅读(115)  评论(0编辑  收藏  举报