表ABC
id-a-b-c
1-1-1-1
2-2-3-5复制后的结果如下
insert into ABC select * from ABC where id='2'id-a-b-c
1-1-1-1
2-2-3-5
3-2-3-5
id-a-b-c
1-1-1-1
2-2-3-5复制后的结果如下
insert into ABC select * from ABC where id='2'id-a-b-c
1-1-1-1
2-2-3-5
3-2-3-5
insert into 时写上具体的字段,去掉自增的ID。insert into ABC(字段) select 字段 from ABC where id='2'
declare @ABC table (id int identity(1,1),a int,b int,c int)
insert into @ABC
select 1,1,1 union all
select 2,3,5insert into @ABC(a,b,c)
select a,b,c from @ABC where id='2'select * from @ABC
/*
id a b c
----------- ----------- ----------- -----------
1 1 1 1
2 2 3 5
3 2 3 5
*/
select a,b,c from @ABC where id='2'select * from @ABC不用写