top of page

Oracle

Public·1 member

Bhanu Uday
Codersarts Employee

Codersarts Team

Java Developer

ORDER BY clause in Oracle - for Sorting data

In Oracle, ORDER BY Clause is used to sort or re-arrange the records in the result set.


The ORDER BY clause is only used with SELECT statement. If you don't know about select statement click here to know.

Syntax:

SELECT expressions  
FROM tables  
WHERE conditions  
ORDER BY expression [ ASC | DESC ];   

ASC : ascending order.

DESC : descending order.


Example:

Without ASC/DESC:

It use ASC by default;

SELECT *  
FROM students  
ORDER BY sname;


With DESC:

SELECT *  
FROM students  
ORDER BY sname DESC;  



Thank you for reading.

4 Views
bottom of page