用一條sql查詢出每門課程都大於80分的學生姓名


准備:

表名:testscore

表字段及值

 

 方法一:

SELECT name from testscore GROUP BY name HAVING min(score)>80

結果圖:

 

 

方法二:

SELECT DISTINCT name from testscore where name not in (select name from testscore where score<80)

結果圖:

 

 

方法三:

SELECT * from (SELECT name,min(score) 最小成績 from testscore GROUP BY name) t where t.最小成績>80

結果圖:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM