会SQL的高手请进!!!
来源:百度知道 编辑:UC知道 时间:2024/06/08 19:15:17
我是统计各分数段学生的人数就可以了呀
select * from
(select count(姓名)as "语文<60" from 成绩表 where 语文<60)as tab1,
(select count(姓名)as "语文>80" from 成绩表 where 语文>80 )as tab2,
(select count(姓名)as "60<语文<80" from 成绩表 where 60<语文 and 语文<80)as tab3
go
我想着应该是你想要得!
我觉得你应该去实验一下我们给你的语句,然后再来补充。
晕!
你说的条件不是自相矛盾吗?
一:大于60,又要60-80之间????而且又要语文大于80??
不知道你要搞什么???
反正给你写三条语句:
select * from 表 where 语文 >60
select * from 表 where 语文 between 60 and 80
select * from 表 where 语文>80
不早说:
下面给你一个语句,看你能否受到启发……
select name,count(*) from ts_province where name like '湖_' group by name
select * from (select 大于60,成绩 from 成绩表 where 语文>60 ) as tab1,(select 大于60小于80,成绩 from 成绩表 where 语文>60 and 语文 <80 ) as tab2,(select 大于80,成绩 from 成绩表 where 语文>80 ) as tab3
order by 成绩
select * from 成绩表 where 语文>60
select * from 成绩表 whe