How to do mysql rstrip

时间:2016-07-11 20:59:06

标签: mysql

I have the following two values:

EN,
EN,FR

I want to change this to be as follows:

EN
EN,FR

How would I do the equivalent of:

str.rstrip(',')

in mysql?

1 个答案:

答案 0 :(得分:3)

Use trim() and specify exactly what (in this case ,) and where (TRAILING, LEADING or BOTH):

  SELECT TRIM(TRAILING ',' FROM 'EN,');