بازه اعداد را باید با and بیان کنید.
از تابع count استفاده کنید و شرط شمارش را داخل همین فانکشن بیان کنید
select
COUNT(case when x>=1 and x<=14 then x else null end) 'range1',
COUNT(case when x>=16 and x<=30 then x else null end) 'range2',
COUNT(case when x>=31 then x else null end) 'range3'
from [Table_Name]
اگر هم میخواهید طبق کوئری آقای رامین مرادی انجام بدید بایست تغییراتی بدید تا ببتونید بشمارید
declare @n1 as int = 0;
declare @n2 as int = 0;
declare @n3 as int = 0;
select
@n1 = @n1 + (case when x>=1 and x<=14 then 1 else 0 end),
@n2 = @n2 + (case when x>=16 and x<=30 then 1 else 0 end),
@n3 = @n3 + (case when x>=31 then 1 else 0 end)
from [Table_Name]
select @n1, @n2, @n3