Collections:
Sort Query Output in Descending Order in Oracle
How To Sort Query Output in Descending Order in Oracle?
✍: FYIcenter.com
If you want to sort a column in descending order, you can specify the DESC keyword in the ORDER BY clause. The following SELECT statement first sorts the department in descending order, then sorts the salary in ascending order:
SQL> SELECT department_id, first_name, last_name, salary
FROM employees ORDER BY department_id DESC, salary;
DEPARTMENT_ID FIRST_NAME LAST_NAME SALARY
------------- --------------- --------------- ----------
Kimberely Grant 7000
110 William Gietz 8300
110 Shelley Higgins 12000
100 Luis Popp 6900
100 Ismael Sciarra 7700
100 Jose Manuel Urman 7800
100 John Chen 8200
100 Daniel Faviet 9000
......
⇒ Count the Number of Rows with SELECT Statements in Oracle
⇐ Query Output Sorted by Multiple Columns in Oracle
2019-12-19, 2665🔥, 0💬
Popular Posts:
How To Get the Definition of a Stored Procedure Back in SQL Server Transact-SQL? If you want get the...
How Run SQL*Plus Commands That Are Stored in a Local File in Oracle? If you have a group of commands...
How To Revise and Re-Run the Last SQL Command in Oracle? If executed a long SQL statement, found a m...
How To Connect to a MySQL Server with a Port Number in MySQL? If you want to connect a MySQL server ...
How To Concatenate Two Character Strings Together in SQL Server Transact-SQL? Concatenating two char...