Declare @a1 INT,@a2 INT,a3 INT,a4 INT ,@a5 INTselect @a1=count (*) from 表1 where ....
select @a2=count (*) from 表1 where ....
select @a3=count (*) from 表1 where ....
select @a4=count (*) from 表1 where ....
select @a5=count (*) from 表1 where ....insert into 表2 values (@a1,@a2,@a3,@a4,@a4,@a5)
select @a2=count (*) from 表1 where ....
select @a3=count (*) from 表1 where ....
select @a4=count (*) from 表1 where ....
select @a5=count (*) from 表1 where ....insert into 表2 values (@a1,@a2,@a3,@a4,@a4,@a5)
解决方案 »
- 请教一个关于SQL Server群集的问题,急!!!!!!!!!!
- 数据库中一个字段取值为int,这个字段的值是几,数据库中就将这条记录插入几条。sql怎么实现?
- 什么是 级联更新约束???
- 清除结果栏 sql2005
- 求一个SQL语句??
- 一个日期相减问题
- 自动编号 类型在Access还有MS SQL中如何定义----在线等待
- 求Table導出到Excel的幾種方法
- 自动安装数据库(.mdf/.ldf)问题
- sky_blue(老衲)兄的100分, 谢谢!(详情见一个初中级难度问题请高手帮忙! 分好说, 帮我解决的至少500。帖子)
- acess数据库导入sql server中,其中的ID不能自己增长了,如何做得像ACCESS一样,自己长ID
- 300分,DELPHI及SQL SERVER高手请进!
insert into 表2
select conut(*) from 表1 where
union
select conut(*) from 表1 where
union
select conut(*) from 表1 where
union
select conut(*) from 表1 where