“MySQL remove duplicatas” Respostas de código

MySQL remove duplicatas

DELETE c1 FROM tablename c1
INNER JOIN tablename c2 
WHERE
    c1.id > c2.id AND 
    c1.unique_field = c2.unique_field;
Matteoweb

Selecione onde duplicar mysql

SELECT 
    col1, COUNT(col1),
    col2, COUNT(col2)
FROM
    table_name
GROUP BY 
    col1, 
    col2
HAVING 
       (COUNT(col1) > 1) AND 
       (COUNT(col2) > 1);
Xanthous Xenomorph

MySQL Excluir linhas duplicadas, mas mantenha uma

DELETE c1 FROM contacts c1
INNER JOIN contacts c2 
WHERE
    c1.id > c2.id AND 
    c1.email = c2.email;
Stefan Schnabeltier

Como excluir todos os itens duplicados no MySQL

DELETE FROM FriendsData WHERE fID 
       NOT IN ( SELECT fID FROM FriendsData 
                   GROUP BY UserID, FriendsUserID, IsSpecial, CreatedBy)
Mobile Star

MySQL exclua duplicatas mais antigas

 delete test
   from test
  inner join (
     select max(id) as lastId, email
       from test
      group by email
     having count(*) > 1) duplic on duplic.email = test.email
  where test.id < duplic.lastId;
Powerful Penguin

Remova duplicata mysql

DELETE c1 FROM addresslist c1
INNER JOIN addresslist c2 
WHERE
    c1.id > c2.id AND 
    c1.`city` = c2.`city` AND
    c1.`province` = c2.`province` AND
    c1.`pgiRegion` = c2.`pgiRegion`
Uninterested Unicorn

Respostas semelhantes a “MySQL remove duplicatas”

Perguntas semelhantes a “MySQL remove duplicatas”

Mais respostas relacionadas para “MySQL remove duplicatas” em Sql

Procure respostas de código populares por idioma

Procurar outros idiomas de código