SQL CEILING or CEIL scalar function in DB2 for i SQL

SQL CEILING or CEIL scalar function in DB2 for i SQL
SQL CEILING or CEIL scalar function in DB2 for i SQL. sql function, db2 sql, ibmi db2, sql, sql tutorial, db2 for i sql
SQL CEILING or CEIL scalar function in DB2 for i SQL

CEILING or CEIL

The CEILING function returns the smallest integer value that is greater or equal to the passed numeric expression.

CEILING(numeric-expression)

Or

CEIL(numeric-expression)

Example

using the CEILING function on positive and negative values.

SELECT CEILING(4.6), CEILING(5.1), CEILING(-2.4), CEILING(-5.5), 
CEILING(0) FROM SYSIBM.SYSDUMMY1

Or

SELECT CEIL(4.6), CEIL(5.1), CEIL(-2.4), CEIL(-5.5), 
CEIL(0) FROM SYSIBM.SYSDUMMY1

Output:

CEILING ( 4.6 )  CEILING ( 5.1 )  CEILING ( - 2.4 )  CEILING ( - 5.5 )  CEILING ( 0 )  
        5                6                 2-                 5-                    0  

Post a Comment

© AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain