我试图从dbo.Marks
表中找到累积成绩点平均值(CGPA)。它的列如下:
我正在尝试此查询,即
select FirstName as Name, GPA AS CGPA from dbo.Marks where FirstName='Nabia' ;
但是,它没有显示我的愿望答案。
累计平均成绩点(CGPA)= CreditHours * GPA / SUM CreditHours
任何人都可以告诉我,我怎样才能从这张愿望表中获得CGPA?
答案 0 :(得分:1)
SELECT
SUM(CreditHours * GPA) / SUM(CreditHours) AS CGPA
FROM
dbo.Marks
WHERE
FirstName = 'Nabia';