MYSQL #1093_MySQL
程序员文章站
2022-06-15 11:02:16
...
目前在写程序时,在处理MYSQL时遇到一个问题,问题如下
update dealer_admin set is_super_admin=1 where id in (select id from dealer_admin group by dealer_id );
此时会报:#1093 - You can't specify target table 'dealer_admin' for update in FROM clause
在网上找了一个暂时可以解决的方法
create temporary table tmp (id int);
insert into tmp (id) select id from dealer_admin group by dealer_id;
update dealer_admin set is_super_admin=1 where id in (select id from tmp);
上一篇: Python并发爬虫常用实现方法解析
下一篇: phpmyadmin筑表