MySQL | You can't specify target table 'a' for update in FROM clause

后端 未结 4 1567
无人共我
无人共我 2021-01-16 04:14
DELETE FROM table_a WHERE id IN(
    SELECT table_a.id AS id FROM table_a, table_b 
    WHERE table_a.object_id = 1 AND table_a.code = \'code\' 
        AND table_a.         


        
4条回答
  •  情书的邮戳
    2021-01-16 04:28

    My Way ... If you could use that!

    DELETE FROM table_a WHERE id IN(SELECT id FROM(SELECT id FROM table_a WHERE userid=99 GROUP BY mobile HAVING COUNT(mobile) > 1) as t2)
    

提交回复
热议问题