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 查询,需要改成中间临时表再查询
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 查询,需要改成中间临时表再查询