ROUND Function
The ROUND function returns the value of numeric_expr rounded to num places to the right
of the decimal point.
ROUND is a Neoview extension.
ROUND(numeric_expr [ , num ] )
numeric_expr
is an SQL numeric value expression.
num
specifies the number of places to the right of the decimal point for rounding. If num is a
negative number, all places to the right of the decimal point and |num| places to the left of
the decimal point are zeroed. If num is not specified or is 0, then all places to the right of the
decimal point are zeroed.
For any exact numeric value, the value numeric_expr is rounded away from 0 (for example,
to x+1 when x.5 is positive and to x-1 when x.5 is negative). For the inexact numeric values
(real, float, and double) the value numeric_expr is rounded toward the nearest even number.
Examples of ROUND
•
This function returns the value of 123.46.
ROUND(123.4567,2)
•
This function returns the value of 123.
ROUND(123.4567,0)
•
This function returns the value of 120.
ROUND(123.4567,-1)
•
This function returns the value of 0.
ROUND(999.0,-4)
•
This function returns the value of 1000.
ROUND(999.0.-3)
•
This function returns the value of 2.0E+000.
ROUND(1.5E+000,0)
•
This function returns the value of 2.0E+00.
ROUND(2.5E+000,0)
•
This function returns the value of 1.0E+00.
ROUND(1.4E+000,0)
ROWS SINCE Function
The ROWS SINCE function is a sequence function that returns the number of rows counted since
the specified condition was last true in the intermediate result table ordered by a SEQUENCE
BY clause in a SELECT statement. See
ROWS SINCE is a Neoview SQL extension.
392
SQL Functions and Expressions
"SEQUENCE BY Clause" (page
268).