To sort the result set in ascending or descending order, use the ORDER BY keyword. By default, the ORDER BY keyword organises the records in ascending order. Use the DESC keyword to sort the records in descending order.
The ORDER BY clause is used to arrange entries in ascending or descending order on one or more columns. If the query contains them, the ORDER BY clause must occur after the WHERE, GROUP BY, and HAVING clauses.
A SQL SELECT query with the ORDER BY clause returns a result set with the rows sorted by the values of one or more columns.
SELECT name, credit limit FROM customers ORDER BY 2 DESC, 1; The name column is positioned 1 while the credit limit column is positioned 2. These column positions were utilised in the ORDER BY clause to tell Oracle to sort the data.
The WHERE clause can be used with or without the ORDER BY declaration.
Learner's Ratings
3.9
Overall Rating
50%
18%
9%
18%
5%
Reviews
S
Swati Patil
5
Excellent
A
Avinash Rawat
4
I want to assignment answer and data. excellent teach
rawatavinash1995@gmail.com
P
Pravin Kashid
5
excellent teaching technique...one of the best course content...
Share a personalized message with your friends.