sql - Deleting orphans from a table -


i trying clean table there quite few orphaned items.

i approaching checking see if there relationship table looking null values.

   delete table1  left join table2 on table1.id = table2.id     table2.id null 

i error left outer join not valid.

i looking suggestions on other ways can delete these orphans broken relationship

try this:

delete         table1 not exists (select null table2 table1.id = table2.id) 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -