zoukankan      html  css  js  c++  java
  • LeetCode 【困难】数据库-第1412 :查找成绩处于中游的学生

    题目

    数据

    结果

    解答

    1.

    select distinct(Exam.student_id) as STUDENT_ID,
    	    Student.student_name as STUDENT_NAME 
    from Exam 
    join Student on Student.student_id = Exam.student_id
    

    2.结果、撇去最高、最低分。

    select distinct(Exam.student_id) as STUDENT_ID,
    	    Student.student_name as STUDENT_NAME 
    from Exam 
    join Student on Student.student_id = Exam.student_id
    
    where Exam.student_id not in
    	(select distinct(student_id) from Exam 
    			where (exam_id,score) in(select exam_id,max(score) as score from exam group by exam_id)  # 实验最高分
    			or
    			      (exam_id,score) in(select exam_id,min(score) as score from exam group by exam_id)  # 实验最低分
    	) 
    order by Exam.student_id asc;
    

  • 相关阅读:
    DOM深度优先遍历算法
    DOM事件
    DOM修改
    DOM的方法和属性
    DOM简介
    JSON.stringify()
    JSON解析
    JSON对象
    JSON语法
    JSON对比XML
  • 原文地址:https://www.cnblogs.com/Tdazheng/p/14987698.html
Copyright © 2011-2022 走看看