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为表名 上述语句可得到成绩的分段统计
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为表名 上述语句可得到成绩的分段统计
转载于:https://www.cnblogs.com/diwer/archive/2012/05/30/2526781.html