SQL ORDER BY Clause
SQL ORDER BY Clause
ORDER BY clause is used to sort the data in ascending or descending order, in SQL Server bydefault data will not be inserted in any order even if you have an index.
Syntax:
SELECT expressions
FROM tables
WHERE conditions
ORDER BY expression [ ASC | DESC ];
We will take an example of table [Person] to sort the column order by FirstName in ascending order.
SELECT
[FirstName]
,[MiddleName]
,[LastName]
FROM [Person].[Person]
ORDER BY FirstName;
Advertising