When LIMIT cuts through tied sort values, an explicit tie-breaker makes the kept rows auditable.
highlighted = computed this step
Input table
Start with orders where two rows share the same amount.
Orders with ties
Order query
Order by amount first, then use order_id as the tie-breaker before applying the limit.
ORDER BY amount DESC, order_id ASC LIMIT
Ordered output
The limit keeps the first rows from that explicit tie-broken order.
tie-broken top rows