Using the ORDER BY Clause :- Sort retrieved rows with the ORDER BY clause
• ASC: ascending order, default
• DESC: descending order - The ORDER BY clause comes last in the SELECT statement
- SELECT ename, job, deptno, hiredate FROM emp ORDER BY hiredate ;
Sorting in descending order :- SELECT ename, job, deptno, hiredate FROM emp ORDER BY hiredate DESC ;
Rules of Precedence :- Arithmetic operators
- Concatenation operator
- Comparison conditions
- IS [NOT] NULL, LIKE, [NOT] IN
- [NOT] BETWEEN
- Not equal to
- NOT logical condition
- AND logical condition
- OR logical condition