Creating Subtotals and Totals in Aggregated Queries
Grouping Sets are an effective way to add subtotals to aggregated queries. T His article explains how.
2020-09-25 (first published: 2018-09-06)
9,745 reads
Grouping Sets are an effective way to add subtotals to aggregated queries. T His article explains how.
2020-09-25 (first published: 2018-09-06)
9,745 reads
Writing aggregate queries is one of the most important tasks for anyone working with T-SQL. Determining the expressions required in the GROUP BY clause is not that difficult, but what do you do if you need to include different combinations of group by expressions in the same result set? Alfonso demonstrates how to use the GROUPING SETS operator to accomplish this task.
2017-12-18
4,860 reads
There are few parts of SQL Syntax as familiar as the GROUP BY clause of the SELECT statement. On the other hand, CUBE and ROLLUP remain mysterious despite their usefulness and GROUPING SET is positively arcane, especially if you are too shy to reveal your ignorance of the subject by asking! William Brewer saves you the hassle.
2015-11-17
4,187 reads
In this article I will be expanding on my discussion of the GROUP BY clause by exploring the ROLLUP, CUBE and GROUPING SETS operators. These additional GROUP BY operators make it is easy to have SQL Server create subtotals, grand totals, a superset of subtotals, as well as multiple aggregate groupings in a single SELECT statement.
2012-08-22
17,161 reads
2011-10-12 (first published: 2011-08-31)
909 reads
As reporting requirements increase, it seems that aggregate functionalities have thankfully risen to the occasion concurrently. To maintain its competitive edge as Staples Canada’s best vendor, BaldGorilla, where I’m currently consulting, has been able...
2009-02-05
2,050 reads
SQL Server 2008 has a number of enhancements over 2005 that make it a more capable platform. New author Arshad Ali brings us an overview and some code about a few T-SQL changes.
2010-03-05 (first published: 2009-01-22)
40,241 reads
Don Schlichting examines several SQL Server 2008 grouping functions including GROUP BY, GROUPING SETS, CUBE, and ROLLUP. In addition, he demonstrates how to use SUM and COUNT in a WHERE clause after rows have been grouped.
2009-01-13
3,724 reads
This article shows how to use the GROUPING SETS feature in SQL Server 2008
2008-11-19
3,390 reads
Doug, Am going to pull the query out and see what I can do about indexes. Prestatie table contains about 700.000 records and joins to PrestatieHistoriek which contains about 900.000 records and growing at about 100.000 a month (2 months in production now). What worries me a bit is that the procedure executes reasonably fast […]
2005-04-08
By Steve Jones
I can’t remember how I heard about Small Data SF 2024, but it caught...
By Steve Jones
moledro – n. a feeling of resonant connection with an author or artist you’ll...
By Arun Sirpal
Let’s go back to data platforms today and I want to talk about a...
Comments posted to this topic are about the item 7 sept, scheduled book
Comments posted to this topic are about the item 7 sept, schedlued article
Comments posted to this topic are about the item 6 sept, published book
Azure Data Lake Storage Gen 2 is built on ...?
See possible answers