0
每組最大值從下表中(稱爲學生):查找PostgreSQL中
name course mark
A a 100
A c 78
A d 83
B a 79
B b 91
C c 78
C d 65
D a 75
我試圖找到名字,其中最高分是當然「a'.So在這種情況下, A和D應該在答案中,但我的查詢似乎只報告所有學生的最高分數:
SELECT name
FROM Student
WHERE mark >= all
(SELECT mark FROM Student WHERE course='a');
我在哪裏出錯了?
編輯您的問題並顯示結果。 –