Collections:
Sort the Query Output in Oracle
How To Sort the Query Output in Oracle?
✍: FYIcenter.com
If you want the returning rows to be sorted, you can specify a sorting expression in the ORDER BY clause. The following select statement returns rows sorted by the values in the "manager_id" column:
SQL> SELECT * FROM departments ORDER BY manager_id;
DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID
------------- -------------------- ---------- -----------
90 Executive 100 1700
60 IT 103 1400
100 Finance 108 1700
30 Purchasing 114 1700
50 Shipping 121 1500
80 Sales 145 2500
10 Administration 200 1700
20 Marketing 201 1800
......
⇒ Query Output Sorted by Multiple Columns in Oracle
⇐ Select Some Rows from a Table in Oracle
2019-12-19, 2460🔥, 0💬
Popular Posts:
What Is Transport Network Substrate (TNS) in Oracle? TNS, Transport Network Substrate, is a foundati...
Where to find answers to frequently asked questions on INSERT, UPDATE and DELETE Statements in MySQL...
What Is an Oracle Instance in Oracle? Every running Oracle database is associated with an Oracle ins...
How to set database to be READ_ONLY in SQL Server? Databases in SQL Server have two update options: ...
How To Recover a Dropped Index in Oracle? If you have the recycle bin feature turned on, dropped ind...