Grouping Sets, With Rollup and With Cube example
Grouping sets allow multiple grouping on columns in a single data set. Rollup and Cube also used for summary rows (allows multiple grouping same as Grouping sets) Example: DECLARE @t TABLE ( idx INT IDENTITY(1, 1) , Country VARCHAR(50) , City VARCHAR(50) , NoOfJobOpenings INT ); INSERT INTO @t ( Country , City , NoOfJobOpenings ) SELECT 'Pakistain' , 'Karachi' , 50 UNION SELECT 'Pakistain' , 'Lahore' , ...
Comments
Post a Comment