Write a SQL query to handle incremental data loads from a source table.
Use finacle_source_accounts as the source and finacle_account_snapshot as the target. Load records newer than the target's latest loaded timestamp, retain only the newest source version per account, and insert or update the target.
account_id, customer_name, status, balance, and source_updated_at for rows loaded or updated.account_id ascending.| Column | Type | Description |
|---|---|---|
| source_row_idPK | INT | Unique source extract row identifier |
| account_id | INT | Finacle account identifier |
| customer_name | VARCHAR(100) | Account holder name |
| status | VARCHAR(20) | Account status from the source |
| balance | NUMERIC(12,2) | Account balance |
| source_updated_at | TIMESTAMP | Source system modification timestamp |
| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Finacle account identifier |
| customer_name | VARCHAR(100) | Account holder name |
| status | VARCHAR(20) | Latest loaded account status |
| balance | NUMERIC(12,2) | Latest loaded account balance |
| source_updated_at | TIMESTAMP | Latest source timestamp loaded |