Re: missing master records
Posted in 1994
In article <321ofb$q8n@emory.mathcs.emory.edu> tilh@sin-co.sin-ro.DHL.COM (Ti Lian Hwang) writes:
>Anybody out there knows how to select records from one table (table 1)
>which has a common key with another table (Table 2), and where the record
>exists in table 1 but not in table 2 ?
>
>Eg. I've got a master invoice table "invmst", and a invoice line items table
>"invlin". They have a common key "invoice". I want to find records in the
>"invlin" table which has no corresponding "invoice" number in the "invmst"
>table.
>
>I've seen the solution somewhere, using a nested select, but I have not
>been able to dig it up since.
>
One way:
select unique inv_num
from invlin
where invlin not in ( select invlin
from inv_mast )
Paul