我有三個表:student
,subject
和score
。
我想顯示每個學生的max(subject_id)
的詳細信息。加入MAX表功能
學生表
student_id student_name exam_date
1 Sharukh 24/06/12
2 Amir 23/06/12
主題表
subject_id sub_name
200 Maths
300 English
400 Science
評分表
student_id subject_id score
1 200 50
1 300 20
2 300 10
結果建議立即進行刪除d是:
student_id student_name subject_id score
1 Sharukh 300 20
2 Amir 300 10
[SQL選擇只在色譜柱的最高值的行(可能的重複http://stackoverflow.com/questions/7745609/sql-select-only-rows-with-max-value-on- a-column) –