SQL Unmatched records Question

From: Charcoal <who_at_cares.com>
Date: Sat, 12 May 2001 15:09:46 GMT
Message-ID: <_mcL6.264$V5.1159_at_news1.rivrw1.nsw.optushome.com.au>


Hi again,

I have two tables in an Oracle database and I want to display all the records in one table which are NOT in the other table. Let me explain using the schema below:

Seats(SeatID) which ranges from 1 to 10. {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} SoldSeats(FlightID, SeatID) which defines which seats have been sold for a particular flight.

So for example, if seats 1,2,3 have been sold for FlightID 100 then I would want it to return

100 4
100 5
100 6
100 7
100 8
100 9
100 10

But if a seat has been sold in another Flight, then it shouldnt affect Flight 100's results. So what is the SQL Query to do something like this?

Thanks,

Charcoal Received on Sat May 12 2001 - 17:09:46 CEST

Original text of this message