500型万用表使用方法:求sql语句

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 10:55:22
我有两个表 table1 table2 字段(id,material
)完全相同 求sql语句
table1中id>100的字段复制到table2中

在线等
id是自动编号!!

不行啊 !! 什么原因
位于数据表 'table2' 的识别数据行其外显值只有当使用了数据行清单且 IDENTITY_INSERT 为 ON 时才能指定

insert into table2
select * from table1 where id>100

如果table2的id 是自动编号的话
insert into table2(material)
select material from table1 where id>100

但是table2中的id不可以与table1中相同,因为自动编号的列不能用程序控制

select * into table2 T2 from table1 T1 where T1.id > 100

如果id 是字符型的

select * into table2 T2 from table1 T1 where T1.id > '100'

自动编号,主键吧,会冲突的。