网上的第51题
http://wenku.baidu.com/view/5897f82bcfc789eb172dc89c.html我的做法:
select * from 成绩表 where 分数 between (select 分数下届 from 等级表 where 级别='a') and (select 分数上届 from 等级表 where 级别='a')select * from 学生表 a join 成绩表 b on a.学号=b.学号 where b.分数>=(select 分数下届 from 等级表 where 级别='a') and b.分数<(select 分数上届 from 等级表 where 级别='a')感觉语句太长了,请假高手有没更精简的语句!!!
http://wenku.baidu.com/view/5897f82bcfc789eb172dc89c.html我的做法:
select * from 成绩表 where 分数 between (select 分数下届 from 等级表 where 级别='a') and (select 分数上届 from 等级表 where 级别='a')select * from 学生表 a join 成绩表 b on a.学号=b.学号 where b.分数>=(select 分数下届 from 等级表 where 级别='a') and b.分数<(select 分数上届 from 等级表 where 级别='a')感觉语句太长了,请假高手有没更精简的语句!!!
select
*
from
成绩表a,等级表 b
where
a.分数>=b.分数下届 and a.分数<=b.分数下届 and b.级别='a'
and
a.学号=b.学号