select lTrim(cast(price as int)/10*10)+'-'+lTrim((cast(price as int)/10+1)*10),count(*)
from titles
where price is not null
group by lTrim(cast(price as int)/10*10)+'-'+lTrim((cast(price as int)/10+1)*10)
select lTrim(cast(floor(price) as int)/10*10)+'-'+lTrim((cast(floor(price) as int)/10+1)*10),count(*) from titleswhere price is not nullgroup by lTrim(cast(floor(price) as int)/10*10)+'-'+lTrim((cast(floor(price) as int)/10+1)*10)这里LTrim是一个简单的写法,意思是把数字类型转换成字符类型