Posted on 2013-01-24
Let's say I have:
Select BankAccount, LastName from Accounts
and it lists all accounts and the account holders last name... one record per.
Now I want to see their total deposits... ever.
Deposits are in a AccountsTransactions table that has two fields
BankAccount and DepositAmount.
Select BankAccount, LastName, DepositAmount from Accounts, AccountsTransactions
will show a record for each deposit made...
Select BankAccount, LastName, Sum(DepositAmount) from Accounts, AccountsTransactions
will return one record with a grand total of all deposits made.
How do I accomplish this?