Toggle navigation
4
MINDS
Home
Sobre
Contato
Entrar
4
MINDS
4MINDS Gestão de Conhecimento
MySQL - SQL to delete duplicate rows
Publicado por
Alan Rodrigues
, 1 de maio de 2023
Desenvolvimento
Dicas
1853 Acessos
Baixar em PDF
DELETE FROM cidade
LEFT OUTER JOIN (
SELECT MIN(id) as RowId, nome
FROM cidade
GROUP BY nome
) as KeepRows ON
cidade.id = KeepRows.RowId
WHERE
KeepRows.RowId IS NULL