MySQL Forums
Forum List  »  Quality Assurance

Re: Delete ... where ... Select Query
Posted by: Thomas CORBIERE
Date: August 20, 2007 12:46AM

Hello,

The problem is that in the subquery you return the "id" column instead of
the "idMaster" column (I assume this is the foreign key).

You could rewrite it to something like :

DELETE FROM Master
WHERE id = 7
AND id NOT IN (SELECT idMaster FROM Details)


Regards,

Thomas CORBIERE

Options: ReplyQuote


Subject
Views
Written By
Posted
31929
August 19, 2007 10:30AM
Re: Delete ... where ... Select Query
11387
August 20, 2007 12:46AM


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.