也许我缺少一个括号或其他东西,但我很难从我要加入的表变量中删除行并寻找我要加入的键。如果它有价值,那么我就摆脱它。问题是我无法解析查询。有任何想法吗?
declare @MrTemp
(
key1 int
,key2 int
)
insert into @MrTemp
select key1, key2 from ASourceTable
delete
from @MrTemp mt
left join ARealTable art on mt.key1 = art.key1 and mt.key2 = art.key2
where art.key1 is not null and art.key2 is not null