SailPoint Technologies wants to identify person records in its identity data whose sale amount exceeds the amount of the third most recent sale. Write a PostgreSQL query that returns qualifying person IDs.
The third most recent sale is determined by sold_at DESC. Use sale_id DESC as a deterministic tie-breaker when timestamps are equal.
person_id with at least one sale amount greater than that amount.NULL sale amounts through the comparison and return IDs in ascending order without duplicates.| Column | Type | Description |
|---|---|---|
| person_idPK | INTEGER | Unique person identifier |
| person_name | VARCHAR(100) | Person display name |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INTEGER | Unique sale identifier |
| person_id | INTEGER | References persons.person_id |
| sale_amount | NUMERIC(12,2) | Sale value |
| sold_at | TIMESTAMP | Sale timestamp |