SQL - Structured Query Language |
ORDER BY ClauseORDER BY clause is used to display SELECT query result set in Alphabetical or Chronological or Numerical sorting order wise based pre-defined set of column(s). ASC keyword is used to display ascending order and DESC keyword is used to display descending order record(s). The following SQL queries are used to retrieves set of record(s) from PRODUCT Table with ascending and descending Sorting ORDER. -- Example 27 --
SELECT * FROM Product ORDER BY Prod_Name, Exp_Date
SELECT * FROM Product ORDER BY Prod_Code, Exp_Date ASC
SELECT * FROM Product ORDER BY Prod_Code, Exp_Date DESC Query Output Screen |
* * * * *