I have a list of ID's in a table and wish to flag errors in data when the ID is not in the ID table
should I use:
' WHERE [ID] NOT IN (SELECT ID FROM TABLE)'
or
' WHERE NOT EXISTS ( SELECT ID FROM TABLE) '
and why?
I'm struggling to get my head around the difference between the two!!
2006-07-12
14:55:58
·
5 answers
·
asked by
Guru BoB
3
in
Computers & Internet
➔ Programming & Design
SYNTAX CORRECTION
***********************************
select FPN from incomingdata
where dbo.provFPN(FPN)
not in (select hosprov from vwneonates)
VS.
select FPN from incomingdata
where not exists (select hosprov from vwneonates
where dbo.provFPN(FPN)=Hosprov)
2006-07-12
15:24:36 ·
update #1