The following query:
DELETE FROM CO05IN.ININVPRC WHERE IPPART IN (SELECT IPPART FROM CO05IN.ININVPRC left join CO05IN.ININVMST on IPPART = IMP开发者_StackOverflow社区ART 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
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);
精彩评论