Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Round function

Posted on 2008-10-09
2
Medium Priority
?
397 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 1500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
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.

721 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