2016-08-05 83 views
0
Select name 
from score, student 
where student.student_id = score.student_id 
and event_id = 1 
and score.score = (select MAX(score) from score where event_id = 1) 

我測試選擇MAX(分數)from event where event_id = 1)的作品,但是當我嘗試像這樣使用它來查找名稱時,它不能正常工作,它不稱錯誤只是說0結果。 我想問如何使用這種方式或類似的方式獲得價值?選擇查詢取決於最大功能

+0

從得分選擇的名字-----萬一不能從學生或選擇名稱選擇名稱,並從學生 –

+0

大家儘量選擇什麼名字查詢得分則返回0的結果?你可以發佈嗎? –

回答

0
SELECT student FROM table ORDER BY MAX(score) DESC