ORDER BY must be the last clause in a SELECT query. It can only appear after SELECT, FROM, WHERE, GROUP BY, and HAVING clauses. This is because ORDER BY operates on the final result set after all filtering, joining, and aggregation has been performed.