user2590060
user2590060

Reputation: 1

how to sum of records

i have table in which there no. of transactions in many accounts .... how to sum of all transaction according to account wise....as well as i want to display sum of all transactions account num wise of all account number for ex..

account_num     transaction_amt
001                200 
001                300
002                330
002                400

and so on i want to display as

account_num     total_transaction
001               500
002               730

and so on please help me out

Upvotes: 0

Views: 63

Answers (1)

Alan B
Alan B

Reputation: 4288

SELECT account_num, sum(transaction_amt) as total_transaction 
FROM mytable 
GROUP BY account_num

Then press F1 and look at the help under 'SQL-Select'.

Upvotes: 3

Related Questions