Archive for August, 2013

07/08/2013

Update a MySQL column trimming a constant number of characters

Will remove the first 4 characters. E.g. ABCD1234, ABCD1235 -> 1234, 1235:

UPDATE table_name
SET title = RIGHT(column_name, CHAR_LENGTH(column_name) - 4)
WHERE clause;