table "a" cust_id bill_amt total 1 100 300 2 120 120 3 50 100 4 75 225 1 100 300 3 50 100 4 75 225 1 100 300 4 75 225 here total for 1 is 300( 3 times 100 rs amt given by cust 1)