我在 MySQL 5.5 中成功运行了一个查询
I am running a query successfully using in MySQL 5.5
SELECT columnA
FROM
table
GROUP BY
columnA
HAVING
count(*) > 1
但是,我需要使用 DELETE 运行相同的查询,但我有点不确定如何删除?即返回的结果应该被删除吗?
However, I need to run this same query using DELETE and I'm a little unsure how to delete ? i.e. the returned results should be deleted ?
有什么想法吗?
将其放在子查询中:
delete from table
where columnA in (
select columnA
from (
select columnA
from YourTable
group by columnA
having count(*) > 1
) t
)
这篇关于MySQL 删除与分组依据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!