我有以下
delete from Listing
where not exists
(
select 1
from ComparitiveListings
where Listing.ListingKey = ComparitiveListings.ListingKey
)
但我真正想做的是为表MySproc
中ListingKey
的每个LISTING
执行一个存储过程COMPARITIVELISTINGS
,该存储过程在列ListingKey
列中找不到{1}}。
我认为必须有光标的方法,但我不确定?有人在这吗?
答案 0 :(得分:1)
Create proc myProc
As
BEGIN
delete from Listing
where ListingKey not in
(
select ListingKey
from ComparitiveListings
)
END