Solved

Round function

Posted on 2008-10-09
2
395 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

628 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