Answer the question
In order to leave comments, you need to log in
What's wrong with this SQL duplicate removal?
Help correct the request
I want to remove repetitions on the columns post_id, meta_key
DELETE `t1`.* FROM `table` AS `t1`
LEFT JOIN (SELECT `ID` FROM `table` GROUP BY `post_id`, `meta_key` ORDER BY `ID` DESC) AS `t2`
ON `t1`.`ID` = `t2`.`ID`
WHERE `t2`.`ID` IS NULL ORDER BY `t1`.`ID` DESC;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question