在同一个sql语句中如何写不同条件的count数量 (转)

  select         sum(case when (t.条件字段='00') then 1 else 0 end)"描述名称1",         sum(case when (t.条件字段='01') then 1 else 0 end)"描述名称2"        from 表名 t 

 

posted on 2015-05-02 06:03  蓝蓝的天2016  阅读(1343)  评论(0编辑  收藏  举报