MySQL Forums
Forum List  »  Data Warehouse

Re: Design Question
Posted by: Peter Brawley
Date: January 04, 2010 05:32PM

Does this get you started on what you need?

SELECT u.department,u.userid,SUM(e.amount) AS Expenses
FROM userdept u
LEFT JOIN expenses e USING (userid)
GROUP BY u.department,u.userid
WITH ROLLUP;

PB
http://www.artfulsoftware.com

Options: ReplyQuote


Subject
Views
Written By
Posted
6348
November 27, 2009 09:29AM
Re: Design Question
3421
January 04, 2010 05:32PM


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.