Category: SQL

update…where id in (select…) and mySQL ERROR 1093

What’s wrong with this picture? mysql> UPDATE IGNORE flight SET intl=1 WHERE id IN (SELECT f.id AS id FROM flight f LEFT JOIN airport a ON a.id=f.origin WHERE a.country<>‘mx’ FOR UPDATE); ERROR 1093 (HY000): You can‘t specify target table ‘flight‘

Posted in Code, General, SQL