我有查询
SELECT
count(hh.[HouseholdIncome]) CountHH, hh.[HouseholdIncome]
,case
when try_convert(numeric(20), hh.[HouseholdIncome]) between 0 and 4012 then 'ERDC Group 2'
when try_convert(numeric(20), hh.[HouseholdIncome]) between 4013 and 4956 then 'ERDC Group 3'
when try_convert(numeric(20), hh.[HouseholdIncome]) between 4957 and 5899 then 'ERDC Group 4'
end as IncomeGroup
FROM [MergeData].[dbo].[Contact] c
join [MergeData].[dbo].[HouseholdIncome] hh on c.ContactID = hh.ContactID
group by hh.[HouseholdIncome]
order by IncomeGroup asc
我想对收入组进行分组计数(总计第2组,3组,依此类推) 谢谢您的支持