:::: MENU ::::

Using Group By Clause with aggregate functions

  • Oct 20 / 2008
  • 0
Aggregates, dbDigger, T-SQL Interview Questions

Using Group By Clause with aggregate functions

In T-SQL Group by clause is used to summarize data for a given parameter. Real power of Group By clause may be exploited when using with Aggregate functions. Before further example and explanation it would be better to mention list of aggregate functions in T-SQL.
Aggregate functions used in T-SQL are as follows

  • Average
  • BINARY_CHECKSUM
  • CHECKSUM
  • CHECKSUM_AGG
  • COUNT
  • COUNT_BIG
  • DISTINCT
  • GROUPING
  • ROLLUP or CUBE function
  • MAX
  • MIN
  • SUM
  • STDEV
  • STDEVP
  • VAR
  • VARP

For use of explanation above functions you may visit link on MSQLTips.com
In case when aggregate functions are used with Group By clause, aggregate function is applied to each group produced in result. To understand the concept with a very use full example please follow the link to see this use for removing duplicate rows from a table.

Consult us to explore the Databases. Contact us