今天通过命令行想删除一些重复的数据结果执行命令的时候报错了: 执行的命令: DELETE FROM cms_mail where m_create_time < 1585801800 and m_mail_uid in (select m_mail_uid from cms_mail group by m_to_email, m_mail_uid having count(m_mail_uid)> 1)
结果: You can't specify target table for update in FROM clause
解决方案: DELETE FROM cms_mail where m_create_time < 1585801800 and m_mail_uid in ( select m_mail_uid from ( select m_mail_uid from cms_mail group by m_to_email, m_mail_uid having count(m_mail_uid)> 1) as a )