Solved

Round function

Posted on 2008-10-09
2
390 Views
Last Modified: 2008-10-09
Hi,
I use round function in my query.But i want to take 2 decimal places like this number 100.1 ...



SELECT ROUND(salary,2) FROM emloyee

Result:

200.456 --> 200,46

200.1 --> 200.10 (i want to like this)

Open in new window

0
Comment
Question by:erenpasa
2 Comments
 
LVL 15

Accepted Solution

by:
Shaju Kumbalath earned 500 total points
ID: 22676870

select to_char(salry,'999999999.00') from FROM emloyee;
0
 
LVL 2

Expert Comment

by:Monky42
ID: 22677258
What you want cannot be accomplished by the round function, since it is essentially not a rounding issue but a number formatting issue (appending trailing zeros doesn't round the number).
If you want to do this formatting within SQL you will have to use the to_char/to_number function, as shajukg wrote.
A little turotial: http://www.techonthenet.com/oracle/functions/to_char.php
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
oracle rollup query 3 50
How do I get sql developer to give me valuable exception information? 2 46
oracle 11g 23 47
Oracle Listener Not Starting 11 18
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to recover a database from a user managed backup
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now