SQL Server 2000 पर उच्चतम मत वाले उत्तरों में से कोई भी सही नहीं है। शायद वे किसी भिन्न संस्करण का उपयोग कर रहे थे।
SQL Server 2000 पर दोनों के सही संस्करण यहां दिए गए हैं।
select t.range as [score range], count(*) as [number of occurences]
from (
select case
when score between 0 and 9 then ' 0- 9'
when score between 10 and 19 then '10-19'
else '20-99' end as range
from scores) t
group by t.range
या
select t.range as [score range], count(*) as [number of occurrences]
from (
select user_id,
case when score >= 0 and score< 10 then '0-9'
when score >= 10 and score< 20 then '10-19'
else '20-99' end as range
from scores) t
group by t.range