Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1847
  • Last Modified:

Finding Orphaned Records In Oracle Table

I have three Oracle tables that share a common field.  Table A contains all records.  Tables B and C are index tables that contain a unique non-intersecting subset of records that together should equal all records in Tables A.  Table A however contains additional orphaned records that no longer are indexed in either Tables B and C.  How can I find the orphaned records in table A?
1 Solution
select * from tablea
where not exists
(Select 'x' from tableb where tablea.key = tableb.key)
and not exists
(select 'x' from tablec where tablea.key = tablec.key);

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now