Melinda
Melinda

Reputation: 1531

How to add subtotal row after the bottom row using a grouping set in SQL Server 2014

I am having a problem trying to get the SUBTOTAL row to be at the BOTTOM of the rows I'm subtotaling. Instead the SUBTOTAL row is at the TOP of the rows I'm subtotaling. I'm working with SQL Server 2014. If someone could please provide any help/direction on how to put the subtotal row at the BOTTOM of the rows I'm subtotaling it would be appreciated. In the PIC below you'll notice the GROUP BY and GROUPING SET code. The rest of the SQL Query is very complex and long and just included the GROUP BY and GROUPING SET section of the code.

Thanks in advance for any help/direction.

Grouping Set Problem-Subtotal At the Top instead of the bottom of the subtotaled section

Upvotes: 0

Views: 299

Answers (0)

Related Questions