Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 398
  • Last Modified:

Round function

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
erenpasa
Asked:
erenpasa
1 Solution
 
Shaju KumbalathCommented:

select to_char(salry,'999999999.00') from FROM emloyee;
0
 
Monky42Commented:
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now