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
How do I replace RunCommand acCmdImport in Access 2007?
Vista or XP Software for Windows 7
How to access a Windows 7 printer from a Windows 98 SE PC ?
VB program connecting to Access DB - arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
get names of sheets
Mail-Merge Methods C#
SelectSingleNode question
Strategy for Interpreting Questionnaire Responses on Report
How can I convert or cast data in a query to an Access Database?
access DOCmd.output report