34,575
社区成员
发帖
与我相关
我的任务
分享
select S_ID,S_Name,C_ID,C_Name,Score
from S_Table where S_ID in (
select S_ID
from S_Table
where Gender=0
group by S_ID
having sum(Score)>count(*) *60
)
order by S_ID,C_ID
select S_ID,S_Name, C_ID,C_Name,Score from S_Table where Gender=0 and S_ID in (
select S_ID
from S_Table
group by S_ID
having min(Score)>=60
)
select S_ID,S_Name,C_ID,C_Name,Score
from S_Table where S_ID in (
select S_ID
from S_Table
group by S_ID
having sum(Score)>count(*) *60
)
order by S_ID,C_ID
--有考虑到,不同学生,科目数不一样的情况。
select * from S_Table where S_ID in (
select S_ID
from S_Table
group by S_ID
having min(Score)>=60
)