Home » SQL & PL/SQL » SQL & PL/SQL » rounding off column value
rounding off column value [message #330336] Sun, 29 June 2008 13:53 Go to next message
sdhanuka
Messages: 173
Registered: March 2008
Senior Member
hey in one of my column ouput's i get the value as .6234 is it possible control the output and round it of to 1 ?? for represent it as 0.645


SQL> column sal for 0.999
SQL> select (sal)/1000 sal from emp;

   SAL
------
 0.800
 1.600
 1.250
 2.975
 1.250
 2.850
 2.450
 3.000
 5.000
 1.500
 1.100

   SAL
------
 0.950
 3.000
 1.300

14 rows selected.

[Updated on: Sun, 29 June 2008 13:54]

Report message to a moderator

Re: rounding off column value [message #330337 is a reply to message #330336] Sun, 29 June 2008 14:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What about ROUND function?

Regards
Michel
Re: rounding off column value [message #330344 is a reply to message #330337] Sun, 29 June 2008 15:00 Go to previous messageGo to next message
sdhanuka
Messages: 173
Registered: March 2008
Senior Member
yes but round function will round of all the values i just want to round of values occuring below 1

 
   TB_SIZE    TB_FREE    TB_USED      FREE%      USED%
---------- ---------- ---------- ---------- ----------
        10     9.9375     .0625    99.375       .625
       200    18.9375   181.0625    9.46875   90.53125
        10     9.9375      .0625     99.375       .625
        80    78.6875     1.3125  98.359375   1.640625
        10       8.75       1.25       87.5       12.5


only for .625 in this table
Re: rounding off column value [message #330351 is a reply to message #330344] Sun, 29 June 2008 16:34 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Use a combination of CASE and ROUND
Previous Topic: Getting ORA-1427: single-row subquery returns more than one row
Next Topic: Calling procedure from unix shell scripts-URGENT
Goto Forum:
  


Current Time: Mon Dec 05 21:30:22 CST 2016

Total time taken to generate the page: 0.24481 seconds