Hi,
how can i remove the last character from a string ?
Like column="a,b,c,d,"; I want to remove the last comma.
mysql remove last char
Re: mysql remove last char
You can use (in MySQL):
You can also do an update and change all the data.
(Make a backup first ! )
Code: Select all
SELECT column SUBSTRING(column,1,CHAR_LENGTH(column)-1) AS column_part FROM table;
(Make a backup first ! )
Code: Select all
UPDATE table SET column=SUBSTRING(column,1,CHAR_LENGTH(column)-1) FROM table WHERe column Like '%,' ;