2009-04-11 143 views

回答

7

假設理論標記和實用的標記是數字數據類型

SELECT 
    student_id, 
    course_id, 
    subject_id,  
    SUM(theory_marks + practical_marks) AS overall_mark 
FROM 
    table 
GROUP BY 
    student_id, course_id, subject_id 
+0

謝謝你,那不解決我的問題,但只是爲了好奇的緣故,你能告訴我如果列是varchar datetype,如何做同樣的事情? – Sneha 2009-04-11 20:46:04