Knowledge Base
Home Oracle

Oracle ROUND and TRUNC Functions

Category: Oracle | Comments (1)

TRUNC:


TRUNC function truncates that is in other words cuts off to the digits specified.


The general syntax of TRUNC function is:

TRUNC(number, precision);

For instance:


Suppose the value of salary in employee table for ename= ’Exforsys’ is 55.666 Then

Select TRUNC(salary,2) from employee where ename=’Exforsys’;

Gives output as

TRUNC(salary) ------------------ 66.66

ROUND:


ROUND function rounds the number to a specified number of decimal places. The general syntax of TRUNC function is:

ROUND(number, precision);

For instance:


Suppose the value of salary in employee table for ename= ’Exforsys’ is 55.666 Then

Select ROUND(salary,2) from employee where ename=’Exforsys’;

Gives output as

ROUND(salary) ------------------ 66.67

 


Next: Explain about TNSPING

Comments

ROUND function rounds the number to a specified number of decimal places.
TRUNC function cuts off to the digits specified.
Comment posted by: kirangsv on 2008-01-07T04:08:59


Post Comment


Members Please Login

Name:


Email:
 
(Optional. Used for Notification)

Title:

 
Comment:


Validation Code:
 <=>  (Enter this code in text box)
Subscribe





Daily Email Updates

Get Latest Knowledge Base Updates delivered directly to your Inbox...

Enter your email address:

Latest Knowledge Base Updates
 

Oracle Tutorials

 

Related Tutorials

 

Sponsored Links