Thread: A and C not B

A and C not B

From
"Chad Thompson"
Date:
I have a table that lists numbers and gives them a rank either 'A' or 'B'.  There is a ranking of 'C' if the number is not in this table.
I have another that lists numbers.
 
It is very easy to find which number is A or B or C, or A and B.  But if i wanted to find A and C, or B and C, I cannot figure out a sql statement that would give me that. 
 
This is probably very simple, but I am not the best at sql and so cannot wrap my head around it.
 
Thanks in advance
Chad

Re: A and C not B

From
"Chad Thompson"
Date:
 
 
----- Original Message -----
Sent: Wednesday, September 11, 2002 4:45 PM
Subject: Re: [NOVICE] A and C not B

select * from x where y in('A', 'B');
Thats not quite what i want.  Finding A and B are easy as they are in the table.  Finding C is easy because it is not.  But if i want one list of B and C, thats a little harder.  Meaning B which is listed in the table as type B, and C which is not in the table at all.

Re: A and C not B

From
"Chad Thompson"
Date:
 
----- Original Message -----
Sent: Wednesday, September 11, 2002 4:45 PM
Subject: Re: [NOVICE] A and C not B

select * from x where y in('A', 'B');
 

 
Thats not quite what i want.  Finding A and B are easy as they are in the table.  Finding C is easy because it is not.  But if i want one list of B and C, thats a little harder.  Meaning B which is listed in the table as type B, and C which is not in the table at all.
 
I believe I will need something like
select * from lists l, tiers t
where l.number = t.number
and t.tier = B
or t.tier <> A
 
This example obviously doesnt work but maybe it gives a better explanation of what i am looking for.
 
Thanks
Chad