Mysql – Remove firts/last characters from a string

Remove firts or last characters from a string:

UPDATE `table` SET `column` =  TRIM(leading  ‘1c3’  FROM `column`); #first characters (1c3)
UPDATE `table` SET `column` =  TRIM(trailing  ‘xyz’  FROM `column`); #last characters (xyz)

This entry was posted in MySQL. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *