SQL 分段统计

select KSCJ*10 || '--'|| (KSCJ+1)*10 as 成绩段 ,count(KSCJ)  from
(
select floor(KSCJ/10) as KSCJ from kszt
)
group by KSCJ order by  KSCJ*10 || '--'|| (KSCJ+1)*10 desc

KSCJ为表名 上述语句可得到成绩的分段统计

posted @ 2012-05-30 19:57  diwer  阅读(832)  评论(0)    收藏  举报