I have a table under

I want the result to be like

I run the following query
;WITH CTE AS ( Select script_Type = 'SP',detail_warnings ='Consider using EXISTS predicate instead of IN predicate' UNION ALL Select script_Type = 'SP',detail_warnings ='ExcludeItem does not exist in database SQLEye or is invalid for this operation' UNION ALL Select script_Type='SP',detail_warnings ='Values hardcoded in where-clause condition' UNION ALL Select script_Type='Table',detail_warnings ='Table name is not singular Remarks :1:- Missing create index statement.' UNION ALL Select script_Type='Table',detail_warnings ='Check for existence object then Drop statement before create statement' UNION ALL Select script_Type='View',detail_warnings ='Invalid name' ) SELECT script_Type,detail_warnings,COUNT(script_Type) FROM CTE c WITH(NOLOCK) GROUP BY ROLLUP(script_Type,detail_warnings)
But the result is the same as with

What changes do I need to make to get the desired result?
source share