SQL Server - Grouping Set

Publicado el: 21 febrero 2021
en el canal de: PracticalIT
203
2

Introduction

We all know the use of a "group by" statement. Normally a GROUP BY statement is used in conjunction with aggregate functions (like sum, count, avg etc.) to group the result-set by one or more columns. In a sort, whenever data is to be summarized, the developer uses a Group By clause. The GROUP BY clause is also used to get DISTINCT rows from any result set.

GROUPING SET is introduced in SQL Server 2008. GROUPING SET is able to generate a result set that can be generated by a UNION ALL of multiple simple GROUP BY clauses. It is capable of generating a result set that is equivalent to the result set generated by ROLL UP or CUBE operations.

GROUPING SETS Equivalents

Specifying GROUPING SETS as the GROUP BY list is equivalent to a UNION ALL of queries, each with one of the grouping sets as its GROUP BY list. We can also use GROUPING SETS in replacement of ROLLUP and CUBE.

#practicalit #sqltutorial #groupingsetinsqlserver


En esta página del sitio puede ver el video en línea SQL Server - Grouping Set de Duración hora minuto segunda en buena calidad , que subió el usuario PracticalIT 21 febrero 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 203 veces y le gustó 2 a los espectadores. Disfruta viendo!