当前位置: 代码迷 >> Sql Server >> 新手上路,SQL循环
  详细解决方案

新手上路,SQL循环

热度:233   发布时间:2016-04-27 21:53:24.0
新手上路,求助SQL循环
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=1   and   iAlarmType=0
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=1   and   iAlarmType=1
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=1   and   iAlarmType=2
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=1   and   iAlarmType=3
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=2   and   iAlarmType=0
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=2   and   iAlarmType=1
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=2   and   iAlarmType=2
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=2   and   iAlarmType=3
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=3   and   iAlarmType=0
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=3   and   iAlarmType=1
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=3   and   iAlarmType=2
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=3   and   iAlarmType=3
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=4   and   iAlarmType=0
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=4   and   iAlarmType=1
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=4   and   iAlarmType=2
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=4   and   iAlarmType=3
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=5   and   iAlarmType=0
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=5   and   iAlarmType=1
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=5   and   iAlarmType=2
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=5   and   iAlarmType=3
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=6   and   iAlarmType=0
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=6   and   iAlarmType=1
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=6   and   iAlarmType=2
SELECT   count(*)   FROM   tbl_AlarmHistory   where   year(iResTime)=2006   and   month(iResTime)=6   and   iAlarmType=3
  相关解决方案