Oracle Tutorial

What is Oracle
SQL Keywords

Oracle Wildcards

Oracle Wildcards

Oracle Aliases

Oracle Aliases

MySQL Tutorial

MySQL Tutorial

PL/SQL Tutorial

PL/SQL Tutorial

Oracle Interview Questions

Oracle Interview Questions and Answers


Oracle Order By DESC Clause

In Oracle, ORDER BY DESC Clause is used to sort the result-set in descending order. To sort the result set, you must use the ORDER BY clause.

Oracle ORDER BY DESC CLAUSE Syntax

To sort the result set in descending order from existing table, use the following syntax:

Syntax

SELECT col1, col2,...
FROM tablename
ORDER BY col1 [DESC|DESC], col2 [DESC|DESC],...

Parameters:

tablename: The table name from which you want to remove all records.

DESC: To sort data set in DESCending order.

DESC: To sorts data set in descending order.

Oracle ORDER BY CLAUSE example using DESC attribute

The following Oracle statement to retrieve records from "tblCustomerLoan" table with DESC attribute:

Example

SELECT firstName, lastName, address 
FROM tblCustomerLoan Order By firstName DESC;

Note:

In the above example, we have fetched records from "tblCustomerLoan" table with specifying DESC in order by clause.