RTRIM( string_expression )
Custom function used to emulate the behavior
function RTRIM(string){
return string.replace(/s+$/,"");
}
Input:
SELECT RTRIM('LAST TWO BLANK SPACES ') AS [RTRIM]
Output:
RTRIM |
---------------------+
LAST TWO BLANK SPACES|
Code:
SELECT RTRIM('LAST TWO BLANK SPACES ') AS RTRIM;
Result:
RTRIM |
---------------------+
LAST TWO BLANK SPACES|
Code:
CREATE OR REPLACE FUNCTION rtrim(str varchar)
RETURNS string
LANGUAGE JAVASCRIPT
AS
$$
function RTRIM(string){
return string.replace(/s+$/,"");
}
return RTRIM( STR );
$$;
SELECT RTRIM('LAST TWO BLANK SPACES ') AS RTRIM;
Result:
RTRIM |
---------------------+
LAST TWO BLANK SPACES|