34,590
社区成员
发帖
与我相关
我的任务
分享
insert into [table] select '4','李大',ID from [table] where 名字= '李四'
create table #b (id varchar(10),name varchar(10),p varchar(10))
insert into #b
select '1','李四',''
insert into #b select '4','李大',id from #b where name = '李四'
select * from #b
/*
1 李四
4 李大 1
*/
declare @a varchar(20)
select @a=ID from tab where 名字='李四'
insert into tab VALUES (4, '李大',@a )