问题
I am new in oracle and I have one question i.e.: how to display data in descending order without using ORDER BY CLAUSE in Oracle. whether it is in sql or pl/sql.
回答1:
It is not possible to reliably retrieve sorted results without explicitly using ORDER BY... if you cannot use ORDER BY, you would need to organize the code in whichever programming language you're using to pull the data with which is ridiculous.
回答2:
Avoid ORDER BY, use a hierarchical query with flat results, and ORDER SIBLINGS! (okay, this will be exactly the same).
You can also do it with:
SELECT * FROM ...
START WITH 1 = 1
CONNECT BY 0 = 1
ORDER SIBLINGS BY ...
回答3:
to sort ename in ascending order without using order by clause:
select ename from emp
union
select ename from emp;
来源:https://stackoverflow.com/questions/9585390/how-to-display-data-in-descending-order-without-using-order-by-clause-in-oracle