RTRIM stands for right trim, and it trims blank spaces occurring on the
right side of a given string.
RTRIM(string)
select RTRIM('smith ');
------------------------ smith
select RTRIM('Hello');
------------------- Hello
select 'Smith '+' David' as Normal_String,RTRIM('Smith ')+' David' as [truncated string]
Normal_String truncated string ------------- ---------------- Smith David Smith David
In MySQL the RTRIM function also does the same job. i.e. it trims any blank spaces from the right side of a given string.
RTRIM(string)
mysql> select RTRIM('smith '); +-------------------+ | RTRIM('smith ') | +-------------------+ | smith | +-------------------+ 1 row in set (0.00 sec) mysql> select RTRIM('Hello'); +----------------+ | RTRIM('Hello') | +----------------+ | Hello | +----------------+ 1 row in set (0.00 sec)
Back to Converting Functions from MSSQL to MySQL