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.7
Overall Rating
43%
21%
13%
10%
13%
Reviews
A
Arvind Kumar
5
very nice course for begginer to under stand
H
hemant
5
Hello sir, explaination is excellent. I have a request please send the db in excel or SQL file
J
Juboraj Juboraj
4
Explain details & easy to understand.
A
Aman Kanaujia
4
All good , but provide the data also for the assignment , Without data the interest is less day by day from the course. So, try to solve this problem as asap.
S
Snehil
4
Everything is good but keyboard sounds more harsh and overlap your voice whereas this course is best.
F
FAROOK MOHAMMAD
5
Hello sir, explaination is excellent. I have a request please send the db in excel or SQL file.
H
Hari Prakash
4
In SQL Join Function's 2nd video - Teacher's voice dose not match with background content that are plays
A
Aakash Mavar
5
Hello sir
Mera Abhi graduation hu he Mene Mechanical Engineering BTech ki Hai me Data analysis me Apna career Bana skat ho Kya
Share a personalized message with your friends.