I am doing some data clean up and I would like to remove duplicate rows by finding records that have the same "picture id" and "date" values:
Example:
picture_id - 2 date - "13-Jul-18"
picture_id - 2 date - "13-Jul-18"
picture_id - 2 date - "13-Jul-18"
picture_id - 2 date - "13-Jul-18"
DELETE FROM `pictures` WHERE `picture_id` = '2' AND `date` = '13-Jul-18'
Table columns (in order): ID (primary key), picture_id, date, followers
I would like to only delete all but one of the duplicate records. It does not matter which one. How can I accomplish this?
PRIMARY KEYon table.