Grouping sets is one of the cool feature came in SQL SERVER 2008. Lets understand here with problem and solution. Problem:- Suppose , We want an aggregation result in a query with different groups. Firstly we want aggregated result on first column then combination of First & second column then other column combination. So, …