Ja. Du gör partitioneringen i en CASE
klass.
SELECT
COUNT(*),
CASE
WHEN age < 1 THEN 'age1'
WHEN age BETWEEN 1 AND 4 THEN 'age2'
WHEN age BETWEEN 4 AND 9 THEN 'age3'
ELSE 'age4'
END AS ageband
FROM children
GROUP BY ageband;