Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need SQL query for this requirment

22428Feb 28 2005 — edited Feb 28 2005
Hi, can you please write a query for this simple logic. I am confusing myself..

input
SELECT * FROM TEST;
c1 c2 c3
--------------------------
1 1 5000
2 1 10000
3 2 20000
4 2 20000
5 3 30000

output
c1 c2
-------------
1 33%
2 66%
3 50%
4 50%
5 100%

i found some logic
first group by c2 then result of c3 is say 15000,40000,30000
then divide 5000/15000 =33%,10000/15000 =66%,20000/40000=50%,20000/40000=50%
30000/30000 = 100%.


pls write SQL Query for this requiremnt.

Thanks in Advance
Devender
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2005
Added on Feb 28 2005
4 comments
216 views