课程: SQL Server Fundamentals: Master Basic Query Techniques

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Query processing order

Query processing order

- [Instructor] In the previous video, we went over the basics of how aggregate functions work, but now we need to spend a little more time on the rules for manipulating this data into a more useful structure. And here, we will consider how to order and filter results that include data from an aggregate computation. So first, let's talk about the ORDER BY clause. We've touched on it briefly before, but we need to explore it a bit further. So we have a few different options when we want to order this set. We can order by the full_name, an actual column in our table, and the set is returned alphabetized, and I could do that. As we said before, by default, it's ascending, but if I wanted to do it in reverse order, I could designate descending, and then it would be Z to A. I can also order by the aggregate function itself, so I can order by count star. Again, ascending or descending. I could order by multiple columns, the…

内容