4 ms·
It's because the query has an ORDER BY clause that orders it all by sale_date, whereas the RANK() is calculated from subtotal order.
by caf 7y ago
It's because the query has an ORDER BY clause that orders it all by sale_date, whereas the RANK() is calculated from subtotal order.