Reputation: 10458
The following query:
DELETE FROM CO05IN.ININVPRC WHERE IPPART IN (SELECT IPPART FROM CO05IN.ININVPRC left join CO05IN.ININVMST on IPPART = IMPART where IMPART is null);
Creates this on the log: You can't specify target table 'ININVPRC' for update in FROM clause.
What is causing this?
Note using MySQL version 5.1
Upvotes: 1
Views: 175
Reputation: 56407
Try in this way.
DELETE FROM CO05IN.ININVPRC WHERE IPPART IN (select * from (SELECT IPPART FROM CO05IN.ININVPRC left join CO05IN.ININVMST on IPPART = IMPART where IMPART is null) as t);
Upvotes: 2