I have a table called colors. In this table are two fields: color, and is_duplicate. I want to place a 1 in the is_duplicate field if there are more than one of the same values found in the color column.
This is what I have tried so far, but it comes back with errors as I am new to the mysql syntax.
update colors
set is_duplicate = 1
where color
HAVING COUNT(*) > 1
I am doing this so I can then drop all of the copies of the duplicates and at a later time go back and see which records had duplicates at one time.
Any suggestions? Thank you.