October 2nd, 2012, 01:31 AM
Return The Sum Of The Same ID
hey guys I need a little help my problem is this:
ledger_id | date | running_balance | fkmember |
1 | 01/29/12 | 5 | 1 |
2 | 02/16/12 | 30 | 1 |
3 | 02/30/12 | 500 | 2 |
Thats my simple table: Now My Problem is. How can i get the sum of the running_balance of the same fkmember? And my output should be like this when i want to display in PHP.
fkmember | running_balance |
1 | 35 |
2 | 500 |
Please help me guys im in a middle of a project.
October 2nd, 2012, 01:52 AM
Have you managed to find any examples of queries that involve some kind of SUM?
October 2nd, 2012, 02:19 AM
i wish my bank would give me the "sum of the running balance" in my account every month
October 2nd, 2012, 02:39 AM
Yes I Saw Many Examples But None Of It Works. I think Ill Have To Use Inner Join But I Dont Know How To Do It
October 2nd, 2012, 04:08 AM
You need a SUM and a GROUP BY, and nothing else!
October 2nd, 2012, 08:08 AM
Two things to point out.
Originally Posted by rochellecanale
a) you are a new member to the forum
b) the question looks like homework
When regular users see that they expect the poster is trying to get them to do the work for them.
If you are looking for assistance then you need to show that you've done some work. People will be happy to assist when they see you've put in the effort.