You could try this:
select case when Quantity < 10 then '0-9'
when Quantity between 10 and 19 then '10-20'
when Quantity >= 20 then '>= 20'
else null
end,count(*)
from
group by case when Quantity < 10 then '0-9'
when Quantity between 10 and 20 then '10-20'
when Quantity > 20 then '>20'
else null
end
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.