I am trying to create a SELECT statement to obtain the sum of all payments due from a table that contains payment schedule. Fields include PaymentID, PaymentAmount, NumberofMonths. So for example, there are three rows:
PaymentId | PaymentAmount | NumberofMonths
==========================================
1 | 500 | 12
2 | 2000 | 8
3 | 1000 | 6
The total amount of all payments due would be $28,000.00. I’m a bit of a SQL/Oracle novice so I’m not sure how to get started with this.
You can use the aggregate function
SUM()and multiply thePaymentAmountby theNumberOfMonths:See SQL Fiddle with Demo