hi,
can anyone help me with the sql query?
id | date | balance | customer | type
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
1 |2010-02-08 19:57:00 | 150 | Hudson | admin
2 |2010-02-08 20:57:00 | 50 | John | admin
3 |2010-02-08 19:57:00 | 75 | Cherry | clerk
4 |2010-02-09 09:17:00 | 100 | Hudson | admin
5 |2010-02-18 10:24:00 | 125 | Cherry | clerk
6 |2010-02-10 20:57:00 | 150 | John | admin
i have a similar table. and i'd like to retrieve something like this
type | total_customer | total_balance
admin | 2 | 250
cleark | 1 | 125
total_balance is the total of latest balance of all the customers for that type..