Write a SQL query using window functions to identify duplicate records or calculate running totals.
For this exercise, calculate running posted transaction totals for each account. Include only transactions linked to an account and sort each account's results chronologically, using transaction ID to break date ties.
account_id, account_name, transaction_id, transaction_date, amount, and running_total.account_id, transaction_date, and transaction_id.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique account identifier |
| account_name | VARCHAR(100) | Display name of the account |
| account_type | VARCHAR(30) | Account classification |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | INT | Referenced account identifier |
| transaction_date | DATE | Date of the transaction |
| amount | NUMERIC(12,2) | Transaction amount |
| status | VARCHAR(20) | Transaction processing status |