View previous topic :: View next topic
|
Author |
Message |
anandinmainframe
Active User
Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
Hi,
I need a help below is the data in a table
Prod Name Comp Prod Price
A WM 40
B Best 60
C Best 70
D WM 100
and i need the o/p as
Comp
WM 140
Best 130 |
|
Back to top |
|
|
Abijoy
New User
Joined: 24 Mar 2010 Posts: 12 Location: Bangalore
|
|
|
|
Anand,
Try this.
Code: |
SELECT COMP,SUM(PRODPRICE)
FROM TABLE
WHERE 'condition'
GROUP BY COMP |
Thanks |
|
Back to top |
|
|
|