sql分组和聚集

 

select st.name na,co.NAME name,sc.score from scores sc
left join students st on sc.sid = st.id
left join courses co on co.id=sc.cid

sql分组和聚集

共9门课程,获取成绩未填满的学生:

select t.na,count(*) from

(select st.name na,co.NAME name,sc.score from scores sc
left join students st on sc.sid = st.id
left join courses co on co.id=sc.cid) t

group by t.na having count(*)<9;

sql分组和聚集

 

上一篇:windows写注册表文件脚本的编写


下一篇:[NOI2006] 网络收费