91-9990449935 0120-4256464 |
SQL ORDER BY ClauseThe SQL ORDER BY clause is used for sorting data in ascending and descending order based on one or more columns. Some databases sort query results in ascending order by default. SQL ORDER BY syntax: Let us take a CUSTOMERS table having the following records:
This is an example that would sort the result in ascending order by NAME and SALARY. This would produce the following result.
This is an example to sort the result in descending order by NAME. This would produce the following result.
Topics of SQL ORDER BY Clause
SQL ORDER BY ASC
How to select data from database in ascending order? SQL ORDER BY DESCHow to select data from database in descending order? SQL ORDER BY RANDOMHow to select random data from database? SQL ORDER BY LIMITHow to select limited data from database? SQL ORDER BY Multiple ColumnsHow to sort data on multiple columns?
Next TopicSql Order By Ascending Order
|