Jefferies' trade surveillance reporting needs to inspect the seventh completed execution in a deterministic sequence. Write a PostgreSQL query that returns the seventh eligible execution ordered by execution time, with the execution ID as a tie-breaker.
Requirements
- Consider only executions with
status = 'COMPLETED'.
- Assign row positions using
ROW_NUMBER() ordered by executed_at ASC, execution_id ASC.
- Return only position 7, including the execution details and trader name.
- Preserve the execution even when no matching trader record exists.