【发布时间】:2013-02-27 15:28:13
【问题描述】:
我发现选择语句基本上使用不同的 where 子句进行计数。我的问题是,如何将结果合并到一个语句中,以便这些计数可以成为列?
- select count(*) as c1 from table1 where city = 'nyc'
- select count(*) as c2 from table1 where city = 'boston'
- select count(*) as c3 from table1 where city = 'sf'
【问题讨论】: