-1
請考慮我的劇本中,下述如何減去彼此的查詢結果?
select name
into #list_1
from table_1
-- result: a, b, c, d, e
select name
into #list_2
from table_2
-- result: b, e
select name
into #list_3
from table_3
-- result: a
select ??
-- result: 1 - 2 - 3 = c, d
傳播,我有3個臨時表,所有持有人的名字。 #list_1
包含完整列表。我如何從#list_1
中減去#list_2
和#list_3
中的值,以便我得出差異?
我在SQL服務器2008年。如果我看着這一切都錯了,那麼請讓我知道。任何幫助是極大的讚賞。