2014-01-20 39 views

回答

1

閱讀string functions reference,例如,

mysql> SET @str := 'test message-'; 
mysql> SELECT IF(RIGHT(@str, 1) = '-', SUBSTRING(@str FROM 1 FOR LENGTH(@str)-1), @str); 
test message 
相關問題