calculate percent(toad oracle8.5) [message #281365] |
Fri, 16 November 2007 09:51 |
labyrinth248
Messages: 14 Registered: November 2007
|
Junior Member |
|
|
Hello,
I wanted to get a percent of these two columns for a third column:
sum(decode(dol.leak_origin_type, 'Customer Reported', '1', '0')),
sum(decode(dol.priority, 'Prospect Emergency', '1', '0')),
can anyone help
Thanks
|
|
|
|
|
|
|
Re: calculate percent(toad oracle8.5) [message #281480 is a reply to message #281400] |
Sat, 17 November 2007 03:35 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
There's the TO_CHAR function available, which would enable you to properly format calculated value. For example:SQL> select comm, sal, comm/sal*100, TO_CHAR(comm/sal*100, '990.00') formatted
2 from emp where ename = 'FORD';
COMM SAL COMM/SAL*100 FORMATT
---------- ---------- ------------ -------
300 3000 10 10.00
|
|
|