MySQL Forums
Forum List  »  Newbie

JOIN Required?
Posted by: James Hargreaves
Date: May 13, 2005 04:39AM

Hi everyone!

I have two tables A and B:

Table A (AID, BID, Date, Items)
1,1,2005-05-13,95
2,2,2005-05-14,76
3,2,2005-05-14,56
4,2,2005-05-13,52
5,1,2005-05-14,104
6,3,2005-05-13,94
...etc...

Table B (BID, Name)
1,James
2,James
3,Jonathan
...etc...

I need to output cummulative items grouped by Name and Date, so something like:

Query C (Name, Date, Items)
James,2005-05-14,(76+56+104)=236
Jonathan,2005-05-14,(0)=0
James,2005-05-13,(95+52)=147
Jonathan,2005-05-13,(94)=94

Is there some way to do this using a single query?

Thanks for your help!
Jay

Options: ReplyQuote


Subject
Written By
Posted
JOIN Required?
May 13, 2005 04:39AM
May 13, 2005 04:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.