Jump to content

delete from table where id not in other table


bucko

Recommended Posts

Hi,

 

I have this situation in mySQL

 

'table1' has an 'id' field.

'table2' has a 'table1_id' field, same value as table1:id

 

I have deleted some entries from 'table1'

Now I want to delete all entries in 'table2' where there is no 'table_id' in 'table1:id'

 

Can someone please tell me  nice way to perform that request?

 

Thanks in advance for any suggestions.

 

bucko.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.