Collections:
Query Output Sorted by Multiple Columns in Oracle
Can the Query Output Be Sorted by Multiple Columns in Oracle?
✍: FYIcenter.com
You can specifying multiple columns in the ORDER BY clause as shown in the following example statement, which returns employees' salaries sorted by department and salary value:
SQL> SELECT department_id, first_name, last_name, salary
FROM employees ORDER BY department_id, salary;
DEPARTMENT_ID FIRST_NAME LAST_NAME SALARY
------------- --------------- --------------- ----------
10 Jennifer Whalen 4400
20 Pat Fay 6000
20 Michael Hartstein 13000
30 Karen Colmenares 2500
30 Guy Himuro 2600
30 Sigal Tobias 2800
30 Shelli Baida 2900
30 Alexander Khoo 3100
30 Den Raphaely 11000
40 Susan Mavris 6500
50 TJ Olson 2100
......
⇒ Sort Query Output in Descending Order in Oracle
⇐ Sort the Query Output in Oracle
2019-12-19, 3021🔥, 0💬
Popular Posts:
How To View Data Files in the Current Database in Oracle? If you want to get a list of all tablespac...
How To Install Oracle Database 10g XE in Oracle? To install 10g universal edition, double click, Ora...
How To Convert Numeric Values to Integers in SQL Server Transact-SQL? Sometimes you need to round a ...
How to set the current database in SQL Server? Once you are connected to the SQL Server, you should ...
How To Generate CREATE VIEW Script on an Existing View in SQL Server? If you want to know how an exi...