SQL ORDER BY

SQL ORDER BY used to display the results by a specific order, ascending or descending.

Syntax:

SELECT *
FROM TableName
ORDER BY Column1 {ASC/DESC}

Table:Sales

From the above table, if we want the results to display based on the Date field, following SQL can be used.

SELECT *
FROM SALES
ORDER BY Date

Table:ResultSet

29 views

Return to top