Question : Select records that do not match another table

I'm trying to select records from table A that do not have a matching record in table B.  I've most recently tried:

select * from a where a.key not in (select b.key from b group by b.key)

but it just keeps running and running.

I need to know how to do this without having to build a temporary table (not supported in my application).  Thanks.

Answer : Select records that do not match another table

Try this:
select a.key from a, b where a.key = b.key and not exists (select 1 from b where b.key = a.key and b.rectype = 'o')

Hope that helps!
Random Solutions  
 
programming4us programming4us