Exception Join in SQL Server
Posted on 2006-05-23
Is there a more efficient way to perform an exception join on two (very large) tables than using the where clause below?
I want to get just the docnumbers that don't exist in the transactionlog with the criteria in the nested where clause.
select dt.documenttype as 'Document Type'
from docdata itd
join doctypes dt
on itd.doctypenum = dt.doctypenum
and dt.filetypenum = 1
where itd.docnum not in
(select docnum from transactionlog where action=123 and transactiondate > '2005-05-01')