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
count total lines or "returns" from a string of text
I have a usb cash drawer need to make a com1
GridView-FormView Master-Detail Setup (Programmatic Solution)
Windows 7 32 bit vs 64 bit
SQL Report Sort
Simple (I think) but Urgent: Copy (XCopy?) files from multiple subdirectories into one directory
How do you setup the Edge Transport Role in Exchange 2010 if you only have 1 server in the organization?
Design a Query to subtract a record value from previous record value
How to start an application from a .Bat file and then upload files
SQL SERVER 2008 service not starting