MySQL删除与分组依据
我正在MySQL 5.5中成功运行查询
SELECT columnAFROM
table
GROUP BY
columnA
HAVING
count(*) > 1
但是,我需要使用DELETE运行相同的查询,但我不确定如何删除?即返回的结果应该删除?
有任何想法吗 ?
回答:
将其放在子查询中:
delete from table where columnA in (
select columnA
from (
select columnA
from YourTable
group by columnA
having count(*) > 1
) t
)
以上是 MySQL删除与分组依据 的全部内容, 来源链接: utcz.com/qa/423315.html