mysql You can't specify target table 'xxx' for update in FROM clause的解决

DELETE from sp_goodscontent where goodsId in (SELECT t.goodsId from (
SELECT goodsId FROM sp_goodscontent  GROUP BY goodsId
HAVING count(1)>1 ) t)

  之前的sql 查询,需要改成中间临时表再查询

posted @ 2019-04-04 08:38  hoge  阅读(111)  评论(0编辑  收藏  举报