select case when u.reputation between 1 and 10000 then 'l...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select case 
  when u.reputation between 1 and 10000 then 'less than 10K'
  when u.reputation > 10000 then 'greater than 10K'
  end
   as ReputationBoundary,
  count(*) as Amount 
  

from Users u
group by case 
  when u.reputation between 1 and 10000 then 'less than 10K'
  when u.reputation > 10000 then 'greater than 10K'
  end

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results