0

This is my mysqSql table.

m_Id |  m_Mobile |  m_ReceiveFromBranch
________________________________________
1       12345       1
2       12345       5
3       12345       1   //->Duplicate of m_Id 1
4       99999       1
5       88888       2
6       88888       5
7       88888       2   //->Duplicate of m_Id 5

...

How can I delete only duplicate rows? I have more that 10 thousand rows with many duplicates.

A B Catella
  • 308
  • 4
  • 12

1 Answers1

1

Try this

 DELETE a
FROM mytable  as a, mytable  as b
WHERE
  (a.m_mobile   = b.m_mobile )
AND (a.m_ReceiveFromBranch = b.m_ReceiveFromBranch )
AND a.ID < b.ID;
Sunny Khatri
  • 537
  • 7
  • 15