当前位置: 代码迷 >> SQL >> 一条兑现每一天统计数据的sql语句(sql server)
  详细解决方案

一条兑现每一天统计数据的sql语句(sql server)

热度:53   发布时间:2016-05-05 14:36:52.0
一条实现每一天统计数据的sql语句(sql server)

select telco,count(telco) as count,datediff(day,'2012-05-15',left(adate,8)) as arrayNo
from platform.dbo.akn_outgoing_log?
where resp_status=2 and adate>'20120515' and adate<'20120521'
????? and telco in(0011,0003,0001)
????? group by telco,datediff(day,'2012-05-15',left(adate,8)) order by telco,arrayNo

?

adate在数据库类型是字符串如:20120329153854

  相关解决方案