© Ben Brumm 2019
Ben BrummBeginning Oracle SQL for Oracle Database 18chttps://doi.org/10.1007/978-1-4842-4430-2_11

11. Ordering Your Data

Ben Brumm1 
(1)
Melbourne, VIC, Australia
 

In this chapter, you’ll learn how to sort your results in a specific order. In SQL, the data you select from a table is not guaranteed to be shown in a particular order. If you want to show it in a particular order, there is a command you can use.

Results Are Not Ordered

When you run a SELECT query on a table, the data in the table is displayed for you to sees. If you run a SELECT query to get all rows, for example, you see all of the rows.
SELECT id, last_name, salary
FROM employee;
ID   LAST_NAME   SALARY
1    JONES       20000
2    SMITH       35000
3    KING        40000
4    SIMPSON     52000 ...

Get Beginning Oracle SQL for Oracle Database 18c: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.