|
-
Sep 5th, 2006, 03:58 PM
#1
Thread Starter
Addicted Member
Using a nested select
Hi there fellow coders,
I'm trying to create a nested select stmt but I'm not sure how it goes.
I have a table that goes as follow:
Style_Desc
Style_ID
Color_ID
Match
The match field contain either "Y" or "N".
Then I have a basic stmt as in:
Select * from tbl where....
In my returning recordset, some Style_ID are duplicated because one record may contain a "y" and the other record may contain a "N".
I want to leave out the record that contain a "N" , BUT ONLY, if there is a record, for the same Style_ID that contain a "Y". Otherwise I want to return the one with a "N".
So basically, if I come accross records with the same Style_ID, and if one of those records contains a "N" and another one contains a "Y" in Match, I want to drop the record with the "N" and keep the one with the "Y" instead.
Am I making sense here?
TIA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|