Delete all records in TableA whose data in field1 and field2 DO NOT match the data in fieldx and fieldz of TableB : DELETE WHERE « Insert Delete Update « Oracle PL / SQL






Delete all records in TableA whose data in field1 and field2 DO NOT match the data in fieldx and fieldz of TableB

 


    DELETE FROM TableA
    WHERE NOT EXISTS
      ( select *
         from TableB
         where TableA .field1 = TableB.fieldx
         and TableA .field2 = TableB.fieldz );



           
         
  








Related examples in the same category

1.WHERE clause is used to control which rows are affected by the DELETE statement
2.Delete command with conditions
3.Delete clause with sub query
4.Delete statement with where clause and varchar2 type column
5.Delete one row