insert into A (Date,FailCount,FailFirstCount,FailSecondCount,FailThirdCount,RecoveryCount)
select '2014-01-01 00:00:00'
,(select count(*) from [201311] where byAreaName =1)
,(select count(*) from [201311] where byAreaName =1 and FailLevel =1)
,(select count(*) from [201311] where byAreaName =1 and FailLevel =2)
,(select count(*) from [201311] where byAreaName =1 and FailLevel =3)
,(select count(*) from [201311] where byAreaName =1 and IsRecovery=1)
select的多个值分别insert into A表中分别对应各个值
版权声明:本文为yu12345678900原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。