首页 > 其他分享 >1093 - You can't specify target table 'hardware' for update in FROM clause

1093 - You can't specify target table 'hardware' for update in FROM clause

时间:2022-09-23 15:57:45浏览次数:53  
标签:target 1093 tb1 clause hardware table where id

背景

今天想删除历史自动化创建的数据
好家伙执行sql提示了:
1093 - You can't specify target table 'hardware' for update in FROM clause

我写的sql:
DELETE from tb1 where id in (select id from tb1 where num='123')

解决办法

delete from tb1 where id in   (
           select id from (
                       select id from tb1 where num='123'
                           ) as tmp
);

标签:target,1093,tb1,clause,hardware,table,where,id
From: https://www.cnblogs.com/tarzen213/p/16722988.html

相关文章