Categorical summary of SQL statements

2022-05-12 0 By

SELECT Subsidy type,COUNT(name of distinct entity) Number of enterprises,SUM(total amount of declared subsidy) Subsidy amount FROM [worktraining].[dbo].[work] WHERE date of subsidy is not nullThe GROUP by subsidy type with rollupGROUP BY statement is used to combine aggregate functions to group result sets by one or more columns.WITH ROLLUP follows the Group by field to do a summary statistic based on the group field.DISTINCT is used to return a unique DISTINCT value.The SUM function returns the total number of numeric columns.The COUNT() function returns the number of rows matching the specified condition.