3 回答

TA貢獻1825條經驗 獲得超6個贊
select ?sum(case when?addtime between '2012-11-13 00:00:00' and '2012-11-13 23:59:59' then 1 else 0 end) as 舊,sum(case when?addtime between '2012-11-14 00:00:00' and '2012-11-14 23:59:59' then 1 else 0 end) as 新
from?StatisticsInfon

TA貢獻1804條經驗 獲得超7個贊
select count(Azcount) as 新, (
select count(Azcount) as 舊 from StatisticsInfon
where addtime between '2012-11-13 00:00:00' and '2012-11-13 23:59:59'
)from StatisticsInfon
where addtime between '2012-11-14 00:00:00' and '2012-11-14 23:59:59'

TA貢獻1803條經驗 獲得超3個贊
SELECT? *
FROM??? ( SELECT??? COUNT(*)?新
????????? FROM????? StatisticsInfon
????????? WHERE?????xxxx
??????? ) a ,
??????? ( SELECT??? COUNT(*)?舊
????????? FROM??????StatisticsInfon
????????? WHERE?????xxxxxx
??????? ) b
- 3 回答
- 0 關注
- 920 瀏覽
添加回答
舉報