Hi,
I have a database as such:
-------------------------------------------------------------------------------------------------------------------
Brand | Model | UNT_RATE PACKAGE_IND Code
-------------------------------------------------------------------------------------------------------------------
ProductOne | X | 25.50 S
ABC123
ProductOne | Y | 82.10 L
DEFG789
ProductTwo | X | 12.00 S BBB667
ProductTwo | Y | 3.00 P
ASDF321
ProductTwo | Z | 8.20 S
ZZZ543
and now I want to say this in an SQL query:
"If for the same Brand, if there is a record with PACKAGE_IND = "P" or
PACKAGE_IND = "L" then DONT display any of the other records of that
same brand where Code is in this list ('ABC123', 'BBB667') and
PACKAGE_IND = "S"
So the output would be:
-------------------------------------------------------------------------------------------------------------------
Brand | Model | UNT_RATE PACKAGE_IND Code
-------------------------------------------------------------------------------------------------------------------
ProductOne | Y | 82.10 L
DEFG789
ProductTwo | Y | 3.00 P
ASDF321
ProductTwo | Z | 8.20 S
ZZZ543
So only two got eliminated:
ProductOne X - becuase ProductY package_ind is L, so productOne X got
cut cuase it was "S" and was in that list
Similarly, ProductTwo X - becuase ProductTwo-Y got "P" and so
ProductTwo X has S and is in list. Althought ProductTwo Z is in the
same condition, it wasn' t in the list, so its ignored.
I hope someone out there can help...
please please please!