Another syntax that might be simpler, depending on how you relate to it, uses the with keyword. This explicitly creates a named temporary table with the desired order, and then queries it. The order of the new query will be the same as the order of the temporary tables.
WITH temp_table AS (SELECT * FROM emp ORDER BY empno) SELECT empname, salary, status FROM temp_table WHERE salary > 5000;
@Jaychapani's answer is more concise and functionally does the same thing, but the with
syntax is powerful for quite a few other use cases and visually separates them, which can be useful, especially if you have a long subquery that does other things.
source share