62,268
社区成员
发帖
与我相关
我的任务
分享
create table #table (ID char(1),Name char(100))
INSERT INTO #table
select 1 as ID,'Nam1' as Name where not exists(select NULL from #table where ID=1)
INSERT INTO #table
select 2 as ID,'Nam2' as Name where not exists(select NULL from #table where ID=2)
INSERT INTO #table
select 3 as ID,'Nam3' as Name where not exists(select NULL from #table where ID=3)
INSERT INTO #table
select 4 as ID,'Nam2' as Name where not exists(select NULL from #table where ID=4)
INSERT INTO #table
select 5 as ID,'Nam2' as Name where not exists(select NULL from #table where ID=5)
INSERT INTO #table
select 5 as ID,'Nam2' as Name where not exists(select NULL from #table where ID=5)
INSERT INTO #table
select 5 as ID,'Nam2' as Name where not exists(select NULL from #table where ID=5)
INSERT INTO #table
select 5 as ID,'Nam2' as Name where not exists(select NULL from #table where ID=5)
INSERT INTO #table
select 5 as ID,'Nam2' as Name where not exists(select NULL from #table where ID=5)
INSERT INTO #table
select 5 as ID,'Nam2' as Name where not exists(select NULL from #table where ID=5)
select * from #table
drop table #table