I'm trying to add a UNIQUE
index to my table based on several columns. However, it is identifying duplicate entries and is erroring out. I tried using the IGNORE
keyword, but it has been depreciated entirely in 5.7.
Here is my SQL:
ALTER TABLE `CotG`.`city_data`
ADD UNIQUE INDEX `unique_index` (`date` ASC, `player` ASC, `city_id` ASC);
How can I add the unique key and have duplicate rows automatically delete?
Edit: This is not a duplicate of How to delete duplicates on a MySQL table? as the answer that addresses my question is for a MySQL features that has been depreciated.... Which was one of my issues in this question...