Genius Move -- Characteristic Functions

The comment was eaten by Haloscan, but here's the text...

You need to read Rozhenstein on characteristic functions.

select
sum(case when a < .5 then 1 else 0 end) 'A'
,sum(case when a >= .5 and a < .75 then 1 else 0 end) 'B'
,sum(case when a >= .75 then …
more ...