如何计算平均分 [英] how to calculate avarage marks

查看:92
本文介绍了如何计算平均分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



在我的应用程序中,我在数据库中插入以下值并以网格显示。



名字

科目

分数



现在我有另一个网格,我必须显示以下信息< br $>


名称

平均值

平均值将计算为total_marks / 300 < br $>


total_marks是所有主题标记的总和。





请告诉我如何显示这个..

Hi all

In my application i am inserting below values in database and displaying in grid.

name
subject
marks

now i have another grid where i have to display below information

name
average

average will be calculated as total_marks/300

total_marks is sum of all subject marks.


Please tell me how to display this..

推荐答案

尝试:

Try:
SELECT [name], SUM(marks)/300 AS Average
FROM student
GROUP BY [name]





AVG改为SUM以匹配OP - OriginalGriff [/ edit]



[edit]AVG changed to SUM to match OP - OriginalGriff[/edit]


这篇关于如何计算平均分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆