111,126
社区成员
发帖
与我相关
我的任务
分享--> Test Data: @t1
declare @t1 table ([序号] int primary key,[姓名] varchar(2),[电话] int)
insert into @t1
select 1,'aa',123 union all
select 2,'bb',34 union all
select 3,'dd',566 union all
select 4,'ff',423
select * from @t1
--Code
delete from @t1 where 序号=2
insert @t1 select 5,'kk',433
select * from @t1
--Drop
--Result
/*
(所影响的行数为 4 行)
序号 姓名 电话
----------- ---- -----------
1 aa 123
2 bb 34
3 dd 566
4 ff 423
(所影响的行数为 4 行)
(所影响的行数为 1 行)
(所影响的行数为 1 行)
序号 姓名 电话
----------- ---- -----------
1 aa 123
3 dd 566
4 ff 423
5 kk 433
(所影响的行数为 4 行)
*/SELECT * FROM TAB ORDER BY 序号