有如下表
a b c
98.5 93.2 99.2
99.6 94.6 96.3
99.3 98.5 95.3
95.4 92.1 91.2
98.5 94.3 94.5
求以上表中,统计出以下区间出现的各数
如:91.5-93
93.5-95
95.5-98
98-100请高手指点
a b c
98.5 93.2 99.2
99.6 94.6 96.3
99.3 98.5 95.3
95.4 92.1 91.2
98.5 94.3 94.5
求以上表中,统计出以下区间出现的各数
如:91.5-93
93.5-95
95.5-98
98-100请高手指点
a b c
98.5 93.2 99.2
99.6 94.6 96.3
99.3 98.5 95.3
95.4 92.1 91.2
98.5 94.3 94.5
这个是什么啊,
select count(*) from biao where zhi > 91 and zhi < 98 这都能满足需求了。
98.5 93.2 99.2
99.6 94.6 96.3
99.3 98.5 95.3
95.4 92.1 91.2
98.5 94.3 94.5这个又是什么东西。需求不明确。
select sum(case when a>91.5 and a<93 then 1 else 0 end) "91.5-93",
sum(case when a>93.5 and a<95 then 1 else 0 end) "93.5-95",
sum(case when a>95.5 and a<98 then 1 else 0 end) "95.5-98",
sum(case when a>98 and a<100 then 1 else 0 end) "98-100"
from tablename
union all
select sum(case when b>91.5 and b<93 then 1 else 0 end) ,
sum(case when b>93.5 and b<95 then 1 else 0 end) ,
sum(case when b>95.5 and b<98 then 1 else 0 end) ,
sum(case when b>98 and b<100 then 1 else 0 end)
from tablename
union all
.....