I just bumped into this topic;
Delete all Duplicate Rows except for One in MySQL?
This almost fits my needs. But I have 2 tables which contain some (linked) duplicate rows.
The first, main table is "messages". First, before I delete anything, I would like to select them:
SELECT * FROM `messages` n1, `messages` n2 WHERE n1.id > n2.id AND n1.datetime = n2.datetime AND n1.message = n2.message
Secondly, I have the table "labels" in whoch the rows have their own id, but also a link towards the first table, which is msgid. So, messages.id = labels.msgid
The mentioned query finds all duplicates. How to show also the linked rows in the second table?