Microsoft
Software
Hardware
Network
Question : SQL select problem, if and only if using SQL 2005
I need to select contacts that have a subset of specific source codes (i.e. 'DFG20065', 'DS2456jsldf') but do not have any other records with different codes such as 'DTGHS35'.
For example,
select contactid, source from credhistory where
source in ('DFG20065', 'DS2456JSLDF')
is my initial select. However, I need to select contacts with these two and only these two source codes.
Can anyone help?
Thanks!
Answer : SQL select problem, if and only if using SQL 2005
select contactid, source from credhistory where
source in ('DFG20065', 'DS2456JSLDF')
and not exists (select 1 from credhistory where source not in ('DFG20065', 'DS2456JSLDF') )
Random Solutions
SQL Server BIT field true and false
How do I import a .jet database into access that has been locked?
How to supress blank page
IP Forwarding / Routing
Calling Stored Procedure from AfterInsert
Powerpoint slide numbering - start on page 3 as page number 1, question re-posted
Populate missing values in specific Excel worksheet and import into Access
Access a SBS 2003 remotely via Remote Desktop gives a Logon Error.
Mail merge selected records into Word
Compile Error: Object Required