Missing table entries
Posted in 1994
Does anyone know of a way WITHIN sql for identifying missing entries in a
table? I have a master table which contains a unique (indexed) code field.
This code is also used in the detail table. Each code should have *at
least* one entry in the detail table, but it may have more than one. How
do I find those codes which have *no* entry in the detail table?
I can see the missing rows if I do something like:
select table1.code,
table2.code
from table1, outer table2
where table1.code=table2.code
but I have to search the output to find the gaps. The other approach I have
used is to UNLOAD the code from each table to a file and use the UNIX
command comm to find the missing codes.
Does anyone have a better approach?
** Opinions expressed are my own and not necessarily those of my employer
=========================================================================
Barry Toomey Phone +353-1-2822333
AT&T Network Systems Ireland Fax +353-1-2822864
Corke Abbey Avenue, email: bt@irl3b2c.att.com
Bray, uunet: att!irl3b2c!bt
Co. Dublin
Ireland
=========================================================================