Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract information not common to both queries 1

Status
Not open for further replies.

sonikudi

Technical User
Sep 9, 2007
81
US
hey guys,

I have a query called 'non duplicate data' and another query called 'Select common ones'..

'Select common ones' has rows with ID numbers that are also present in 'non duplicate data' qry. what i want to is only show those rows from 'non duplicate data' qry that are not there in query called 'Select common ones'..and i am having a tough time doing that..Following is the query that results in 0 rows:(

Code:
SELECT t3.*
FROM [STEP 4:NonDuplicateData] AS t3
WHERE not exists (SELECT t2.ID FROM [Step 5: SelectCommonOnes] as t2 WHERE t2.ID = t3.ID);

Thanks for any help in advance.
 
SELECT t3.*
FROM [STEP 4:NonDuplicateData] AS t3
WHERE t3.ID not in (SELECT t2.ID FROM [Step 5: SelectCommonOnes] as t2);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top