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

表a 的id字段不做唯一約束,表中aa,bb字段數據重複,目前希望aa,bb字段組合確定唯一一條數據,如何刪除表a中的重複數據,保留id值最小的哪一條數據。 執行sql: delete from a where id not in (select  MIN(id) as id from a GROUP BY aa,bb)     錯誤:You can't specify target table
相關文章
相關標籤/搜索