How to sum two (or more) records [message #21816] |
Mon, 02 September 2002 21:41 |
Bhola Panta
Messages: 5 Registered: September 2002
|
Junior Member |
|
|
Hi!
I need help with this query:
I have a table T. Name, ID. Pref are primary keys.
------------------------------
Name ID Pref Item
101 501 B01 43000
101 502 B01 2000
102 507 B01 525
102 508 B02 820
----------------------------
I want to write a query and get a result like this:
Name Pref Item
101 B01 45000
102 B01 525
102 B02 820
That is, if Name and Pref fields are same, I want to add the item field.
-----------
SELECT Name, Pref, Item
FROM Table T
WHERE XXXXXXXXX
----------------------
Please help. Thank you.
Bhola.
|
|
|
|