Welcome Guest, Not a member yet? Register   Sign In
Use Inner Join To Count Amount Of The Same ID
#1

[eluser]rochellecanale[/eluser]
hey guys just want to ask how can I perform an inner join statement using CI to determine the value of the same ID.

My table example data:

Code:
points_ledger table
ledger_id    |     completion_date     |     fkmember     |    running_balance     |
     1       |        01/29/12         |        1         |         5              |
     2       |        02/16/12         |        1         |         30             |
     3       |        02/30/12         |        2         |         500            |

I want to get this output from my view:
Code:
fkmember          |    running_balance     |
        1         |         35             |
        2         |         500            |

The sense is to add the same fkmember their running balance total.
How can i do this? Please Help Me Guys. I can accept any anwer. Just to answer this problem.
#2

[eluser]bgreene[/eluser]
select fkmember, sum(running_balance) from points_ledger group by fkmember
#3

[eluser]rochellecanale[/eluser]
thanks!! it works. Im glad that you help me. This code can help me a lot!! Thanks again. Godbless




Theme © iAndrew 2016 - Forum software by © MyBB