[thelist] MYSQL - Joining multiple rows and adding a columns values
jason h
jayuk_1 at hotmail.com
Mon Jan 8 11:54:26 CST 2007
I have a table like the following:
recording_id | quantity
1 1
2 1
2 3
1 3
3 3
4 2
5 2
2 2
and what I would like is to create a new table that would look like:
recording_id | quantity
2 6
1 4
3 3
4 2
5 2
What i'm basically trying to do is to create a new table from the existing
table, with joined rows that have the same recording_id, and add the
quantitys together. The order of the rows isn't important.
I've tried a lot of ways and scoured the web for a solution but nothing
seems to work, hope you can help!
_________________________________________________________________
MSN Hotmail is evolving check out the new Windows Live Mail
http://ideas.live.com
More information about the thelist
mailing list