MySQL Forums
Forum List  »  Optimizer & Parser

Hiw to fast delete rows from table in relation?
Posted by: Andrzej Borucki
Date: January 22, 2017 02:21AM

I have two tables:
general:
hash = primary key
code
other

detail:
hash+index = primary key
other

I want delete all rows from general where code=:code and from detail where general.hash=detail.hash
First job is easy:
delete from general where code=:code
Ho do second?

delete from detail where hash = select hash from general where code=:code
?

delete from detail left join general on detail.hash=general.hash where general.code = :code
?

Options: ReplyQuote


Subject
Views
Written By
Posted
Hiw to fast delete rows from table in relation?
1216
January 22, 2017 02:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.