Learn SQL: A Practical Guide for SQL Server and Database Fundamentals by Jacob Schulz

Learn SQL: A Practical Guide for SQL Server and Database Fundamentals by Jacob Schulz

Author:Jacob Schulz [Schulz, Jacob]
Language: eng
Format: azw3, pdf
Published: 2018-05-17T16:00:00+00:00


Using ORDER BY

The ORDER BY clause is simply used to sort the data in ascending or descending order, and is specified by which column that you want to sort by. This command also sorts in ascending order by default, so if you want to sort in descending order, you can use DESC in your command.

SELECT Column_Name1, Column_Name2

FROM Table_Name

WHERE Column_Name3 = 'Value'

ORDER BY Column_Name1, Column_Name2 --Sorts in ascending order, but you can also include ASC to sort in ascending order.

SELECT Column_Name1, Column_Name2

FROM Table_Name

WHERE Column_Name3 = 'Value'

ORDER BY Column_Name1, Column_Name2 DESC --This sorts the data in descending order by specifying DESC after the column list.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.