首页 > 技术文章 > 在同一个sql语句中如何写不同条件的count数量 (转)

wenjie 2015-05-02 06:03 原文

  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 

 

推荐阅读