Which table join should I use
I've got 2 tables Order & Despatch and I'm trying to add some keys to the tables. The OrderNo field is a primary key in Order and a foreign key in Despatch, but it won't let me add the key as there are obviously some records in Despatch that don't exist in Order. I now want to delete these rogue records. My first attempt was as follows but didn't work, any suggestions
delete from Despatch
(select b.ordno from Despatch b
full outer join Order a
on b.ordno = a.ordno
where a.ordno is null)
|