• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Mastering T-SQL > Top Values Queries

Top Values Queries

You use the TOP clause to limit the number of rows that SQL Server includes in the output. Here's an example:

SELECT TOP 10 OrderDate, Sum(Freight) FROM Orders 
     GROUP BY OrderDate
     ORDER BY SUM(Freight) DESC


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint