【发布时间】:2018-11-03 15:09:33
【问题描述】:
【问题讨论】:
标签: sql sql-server tsql sql-server-2005
【问题讨论】:
标签: sql sql-server tsql sql-server-2005
我想你想要条件聚合:
select todaydate, count(*) as totalrow,
sum(case when (numb > 2 and calibration <> 1) then 1 else 0 end) as [max]
from table t
group by todaydate;
【讨论】: