Hello guys I have a sql query that finds sum of columns between some ranges. The query is below
select
sum(case when rating_value between 0 and 1.9 then 1 end) as Poor,
sum(case when rating_value between 2 and 2.9 then 1 end) as Average,
sum(case when rating_value between 3 and 3.9 then 1 end) as Good,
sum(case when rating_value between 4 and 5 then 1 end) as Very_Good
from rating
which outputs like this
poor | good | verygood | average
39 | 131 | 231 | 552
But i want output like this
Rating | Count or Value
-----------------------
Poor 31
Good 21
Average 552
very good 231
Hoping for a positive reply