I’m running a trim query to remove any rows with a trailing “-” in the slug column.
I have rows with duplicates but that is required right now.
How can I fix the error so that it runs the trim query?
UPDATE terms
SET slug = TRIM(TRAILING '-' FROM slug);
The error: #1062 - Duplicate entry 'system' for key 'slug'
If you have a
UNIQUEconstraint set on theslugcolumn, you must remove that:Please note that the above will work only for MySQL – the statement varies as per the database.