Tutorial66.com
@Share Application Development Skill.



Tutorial is tutorial...66 is My Country Code Up to 10 Years EXP for Application Development Role in Thailand.
collapse

Tutorial Category



Topic: Oracle Numeric Functions ABS ,CEIL,FLOOR ,TRUNC,ROUND How to and Example Code  (Read 129 times)


My Development skill
Java JSP Servlet EJB
Spring Framework
Hibernate Framework
iReport Jasper Report
Apache CXF
PHP Codigniter
Oracle PLSQL
Unix Shell Script
Oracle Numeric Functions ABS(number num)
Return absolute value of the number.
Code: [Select]

select abs(-1) from dual   -- return 1
select abs(1) from dual    -- return 1


Oracle Numeric Functions CEIL (number num)
Return Integer value that is Greater than or equal to the number
Code: [Select]

select CEIL(2.1) from dual;  -- return 3
select CEIL(2.5) from dual;  -- return 3
select CEIL(2.9) from dual;  -- return 3


Oracle Numeric Functions FLOOR (number num)
Return Integer value that is Less than or equal to the number
Code: [Select]

select FLOOR (2.1) from dual;  -- return 2
select FLOOR (2.5) from dual;  -- return 2
select FLOOR (2.9) from dual;  -- return 2


Oracle Numeric Functions TRUNC (number num1,number num2)
Return Truncates   value of number 'num1' up to 'num2' decimal places
Code: [Select]

select TRUNC(2.717) from dual;  -- return 2
select TRUNC(2.717,1) from dual; -- return 2.7
select TRUNC(2.717,2) from dual; -- return 2.71


Oracle Numeric Functions ROUND (number num1,number num2)
Return Rounded value of number 'num1' up to 'num2' decimal places
Code: [Select]

select ROUND (2.717) from dual;  --return 3
select ROUND (2.717,1) from dual; --return 2.7
select ROUND (2.717,2) from dual; --return 2.72


« Last Edit: December 28, 2011, 07:28:35 AM by Admin »




SimplePortal 2.3.3 © 2008-2010, SimplePortal