Database Reference
In-Depth Information
Since you want the results listed by SalesOrderID , you use the GROUP BY clause. From the result set,
you see that order 1 had a minimum unit price of 5.1865, a maximum unit price of 2039.994, a total unit
price of 14323.7118, and an average unit price of 1193.6426.
Try It: Using the COUNT Function
Let's find the count of records from the Person.Contact table.
Open a New Query window in SQL Server Management Studio. Enter the following query, and click
Execute. You should see the results shown in Figure 5-13.
Select count(*) as "Total Records"
from Person.Contact
Select count(Title)as "Not Null Titles"
from Person.Contact
Figure 5-13. Using the COUNT aggregate function
 
Search WWH ::




Custom Search