From the course: Implementing Data Engineering Solutions Using Microsoft Fabric (DP-700) Cert Prep by Microsoft Press

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Grouping and aggregating data

Grouping and aggregating data

Grouping and aggregating data In terms of using T-SQL to group and aggregate data, we've got some aggregate functions. We can use SUM to add up values. We can use COUNT to count rows or non-null values. We can use AVERAGE to calculate the average of the values in a column. We've got min and max functions, which allow us to find the minimum and the maximum value in a group of data. Now if we are analysing large amounts of data that integers won't cut, we can use COUNTIGB. It's like COUNTIGB, but it returns a big int. Now our grouping clauses that we use with our aggregate functions, GROUPBY. That's our simplest. we can specify a single column or multiple columns to group our values by. Now grouping sets a little bit more of an advanced concept in that we can actually group by different sets of data. We'll see this in the examples. We can also roll up which produces subtotals and grand totals. It adds rows of data to our grouping output that shows subtotals and grandtotals. And lastly…

Contents