“mysql hapus baris duplikat tetapi simpan satu” Kode Jawaban

mysql hapus duplikat

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

mysql hapus baris duplikat tetapi simpan satu

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

cara menghapus semua item duplikat di mysql

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

mysql hapus duplikat lama

 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

Identifikasi baris dengan 2 nilai kolom yang sama dan hapus duplikat mysql

DELETE c1 FROM contacts c1
INNER JOIN contacts c2 
WHERE
    c1.id > c2.id AND 
    c1.email = c2.email;
Code language: SQL (Structured Query Language) (sql)
Troubled Toad

Hapus duplikat 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

Jawaban yang mirip dengan “mysql hapus baris duplikat tetapi simpan satu”

Pertanyaan yang mirip dengan “mysql hapus baris duplikat tetapi simpan satu”

Lebih banyak jawaban terkait untuk “mysql hapus baris duplikat tetapi simpan satu” di Sql

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya