
July 14th, 2008, 09:26 PM
|
|
Contributing User
|
|
Join Date: Aug 2004
Posts: 192
 
Time spent in forums: 1 Day 17 h 6 m 45 sec
Reputation Power: 5
|
|
|
Sql query help not exists
Hello,
I have two tables A & B. table A has a column for example Color. There are some rows in this table that have value '-2' for Column color.
There is another table B.
Two tables can be joined by column called 'Sample'.
I am trying to find out a way to fetch records that have value of -2 in table A for column Color but these records are NOT IN table B.
I'd appreciate if someone could help me with this a little.
I tried something like this
Code:
select * from table A where A.Color = '-2' and not exists (select * from table B);
but that doesnt work 
|