Jeremy Leys
asked on
Remove duplicates but keep one for combination of two columns in MySQL
Hi,
I have a table heath3_mt_cfvalues that I need to de-dup data on, based on a combination of keys link_id and cf_id.
I have managed to find and remove duplicates that have a different `value` field contents. I now want to remove duplicates but leave one unique value on combination of keys link_id and cf_id for each instance. What would be the query syntax to achieve this?
Table = heath3_mt_cfvalues
id PK int(11)
cf_id int(11)
link_id int(11)
value mediumtext
attachment int(10)
counter int(11)
Check field text
My previous question: Find duplicates for combination of two columns in a MySQL database
I have a table heath3_mt_cfvalues that I need to de-dup data on, based on a combination of keys link_id and cf_id.
I have managed to find and remove duplicates that have a different `value` field contents. I now want to remove duplicates but leave one unique value on combination of keys link_id and cf_id for each instance. What would be the query syntax to achieve this?
Table = heath3_mt_cfvalues
id PK int(11)
cf_id int(11)
link_id int(11)
value mediumtext
attachment int(10)
counter int(11)
Check field text
My previous question: Find duplicates for combination of two columns in a MySQL database
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Brilliant, I take my hat off to you :)
Thanks but I don't deserve that credit. Happy to help. Cheers, Paul
Open in new window