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 ASC Clause

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

Oracle ORDER BY ASC CLAUSE Syntax

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

Syntax

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

Parameters:

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

ASC: To sort data set in ascending order.

DESC: To sorts data set in descending order.

Oracle ORDER BY CLAUSE example using ASC attribute

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

Example

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

Note:

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