background image
<< RANDOM function | SIGN function >>

RTRIM function

<< RANDOM function | SIGN function >>
Derby Reference Manual
137
can be used to force the optimizer to use an index ordered on the desired column(s)
if ordering is a firm requirement.
The data type of the returned value is a BIGINT number.
Syntax
ROW_NUMBER() OVER ()
Example
To limit the number of rows returned from a query to the 10 first rows of table
T
, use the
following query:
SELECT * FROM (
SELECT
ROW_NUMBER() OVER () AS R,
T.*
FROM T
) AS TR
WHERE R <= 10;
RTRIM function
RTRIM removes blanks from the end of a character string expression.
Syntax
RTRIM(CharacterExpression)
A CharacterExpression is a CHAR, VARCHAR, or LONG VARCHAR data type, any
built-in type that is implicitly converted to a string.
RTRIM returns NULL if CharacterExpression evaluates to null.
Examples
-- returns ' asdf'
VALUES RTRIM(' asdf ')
-- returns 'asdf'
VALUES RTRIM('asdf ')
SECOND function
The SECOND function returns the seconds part of a value.
The argument must be a time, timestamp, or a valid character string representation of a
time or timestamp that is not a CLOB, LONG VARCHAR, or XML value. The result of the
function is an integer between 0 and 59. If the argument can be null, the result can be
null. If the argument is null, the result is 0.
Syntax
SECOND ( expression )
Example
The RECEIVED column contains a timestamp that has an internal value equivalent to
2005-12-25-17.12.30.000000. To return only the seconds part of the timestamp, use the
following syntax:
SECOND(RECEIVED)
The value 30 is returned.