Write a SQL query to reconcile two tables and identify rows that are missing or mismatched between them.
Compare records with the same record_id across source_records and target_records. Return only records that exist in one table but not the other, or have different values in any compared column.
record_idrecord_id, both tables' status, amount, and update date values, plus discrepancy_typerecord_id ascending| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique record identifier |
| record_status | VARCHAR(30) | Current source record status |
| amount | NUMERIC(10,2) | Source record amount |
| updated_at | DATE | Date the source record was updated |
| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique record identifier |
| record_status | VARCHAR(30) | Current target record status |
| amount | NUMERIC(10,2) | Target record amount |
| updated_at | DATE | Date the target record was updated |