表單A,ID
A
B
C
D
表單B,ID
B
C
交叉查詢後只會有BC重複,但想刪除不重複的部分AD
DELETE FROM ReportDetail where ReportDetail.UserID in (
SELECT DISTINCT ReportDetail.UserID FROM ReportDetail where ReportDetail.UserID not in (
SELECT Users.UserID FROM Users))