首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

汇聚函数

2012-08-30 
聚集函数不能出现在where中所以查出某些同学的数学分数大于平均分15分select t1.namefrom student t1, cou

聚集函数
不能出现在where中

所以查出某些同学的数学分数大于平均分15分

select t1.namefrom student t1, course t2, student_course t3where t1.id = t3.student_id  and t2.id = t3.course_id  and t2.curse_name = 'Math'  and t3.score > 15 + (  select avg(t3.score)    from course t2, student_course t3   where t2.id = t3.course_id   and t2.curse_name = 'Math'  )

热点排行