The SQL Server SELECT statement in 60 seconds - the ORDER BY Clause #shorts

preview_player
Показать описание
In 60 seconds we'll explore the ORDER BY clause in SQL.
My SQL Server Udemy courses are:
----
In this video, I'm going to show you how to use the SQL Server SELECT statement with the ORDER BY clause. I'll take you through the basics of how the SELECT statement works, and then show you how to use the ORDER BY clause to customize the order of the results.

If you're new to SQL Server, or you've been using it for a while and you're not sure how to use the SELECT statement, this video is for you! By the end of this video, you'll know how to use the SQL Server SELECT statement with the ORDER BY clause, and you'll be able to use it to customize the order of the results in your queries.

Just add the field you want to sort in the ORDER BY clause. It is then sorted ascending or smallest to largest. You can sort text, dates or numbers.

You can sort by multiple fields by separating them by a comma. You can add DESC to sort descending, or optionally add ASC to sort ascending.

You can also sort by a column number. In this example I am sorting by the type column descending. It is not recommended to sort by a column number however.

The ORDER BY clause is the only clause where you can use the aliases you created in the SELECT clause.

If you use a GROUP BY, you will often ORDER BY those same fields.
----
Links to my website are:
Рекомендации по теме