views:

70

answers:

1

My page should shown information like this:

No. Customer Bank_Name Amount
---------------------------
1. AAA Bank A 100
2. BBB Bank B 200
3. CCC Bank A 500
4. DDD Bank C 150
----------------------------
Total 950

How to sum amount as shown below:
Summary

No.Bank_Name Total
-------------------------
1. Bank A 600
2. Bank B 200
3. Bank C 150
-------------------------

+3  A: 

If it's in a database... something like:

SELECT bank, SUM(amount) as `sum`
FROM customers
GROUP BY bank
ORDER BY bank
philfreo
I'm using query SELECT for my field data which one is bank name and amount on it. At my page I'm listed all customer information then at the bottom of page I make summary of each bank and sum amount for each bank (unique).
Chandra
@user394461 Please update your question with this information.
George Marian
My page should shown information like this:<br>No. Name Bank Amount <br>--------------------------- <br>1. AAA Bank A 100 <br>2. BBB Bank B 200 <br>3. CCC Bank A 500 <br>4. DDD Bank C 150 <br>----------------------------<br>Total 950 <br><br>Summary<br><br> Bank Name Total <br>------------------------- <br>1. Bank A 600 <br>2. Bank B 200 <br>3. Bank C 150 <br>------------------------- <br>
Chandra
@user394461 Please, update the question itself -- you can edit it -- and use the code formatting features.
George Marian
Really sorry, i'm just did it today.Thanks.
Chandra
Any idea???? Please.
Chandra