Course Content

  • SQL Filtering Queries

Course Content

FAQs

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.

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere