Conclusion

Aggregates are powerful tools for organizing and interpreting data. SQL Server provides a wide array of common aggregates for you to use, and you can apply them in various flavors by adding keywords to the aggregates. If exactly the right aggregate isn’t already built into SQL Server, you can easily create your own aggregate function through Visual Studio, then call your custom-designed aggregate through a SQL query.

Chapter 5 Quick Reference

ToDo this
Count the records in a tableSELECT COUNT(*) FROM <Table_Name>
Count the number of records with values that are not null in a fieldSELECT COUNT (<Field_Name>) FROM <Table_name>
Count the records that meet a specified conditionSELECT COUNT (*)

FROM <Table_Name>

WHERE <condition>
Count the ...

Get Microsoft® SQL Server™ 2005: Applied Techniques Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.