April 21, 2005 at 9:45 am
I need to perform weekly updates of Table B. The data is derived from a table linked to an excel spreadsheet A. There may be several rows in this table which contain duplicated id's. What I need to do is take just one occurrence of the id but sum the line amount as follows:-
A B
Unique ID Line Amount Unique ID Line Amount
123 800 123 1400
123 200
123 400
How do I best achieve this?
April 21, 2005 at 11:57 am
******************
Dinakar Nethi
Life is short. Enjoy it.
******************
April 21, 2005 at 2:01 pm
you don't need "distinct"
SELECT
[Unique ID],
SUM([Line Amount])
FROM
<tablename>
GROUP BY
[Unique ID]
* Noel
April 22, 2005 at 4:43 am
Thanks very much - that works fine
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply