SQL Grouping Problem

In this forum you can share stuff related to Oracle 11g, 10g, 9i.
Post Reply
zeenat khan
Posts: 35
Joined: Wed Apr 04, 2007 4:15 am
Location: Pakistan

SQL Grouping Problem

Post by zeenat khan »

Dear SQL Champs,

I have two columns like this

Id column a column b
1 a 10000
2 z 20000
3 i 30000
4 z 40000
5 p 50000
6 d 60000
7 a 70000
8 p 80000
9 i 90000

Find the query which will sum the column b, group by column a without disturbing the sequence
Out put should be as follows

A 80000
Z 60000
I 12000
P 13000
D 6000
ahmadbilal
Posts: 615
Joined: Mon Sep 18, 2006 1:32 am
Location: United Arab Emirates
Contact:

Post by ahmadbilal »

select cola,sum(colb)
from table_name
group by cola
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests