添加特定列的值并存储在特定变量中 [英] additng values of particular colum and store in particular variable

查看:86
本文介绍了添加特定列的值并存储在特定变量中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有colums的表格答案为answer_id,question_id,student_id,stu_ans,stu_marks。

i想要添加特定学生的所有分数

并存储在结果表中是result_id,student_id,marks。

i将存储添加的标记结果表但是我不知道如何在整数变量中执行特定学生的标记和存储的添加



例子我想要添加标记,其中student_id = 1

i have table answer with colums as answer_id,question_id,student_id,stu_ans,stu_marks.
i want add all marks of particular student
and store in result table
in Result table colums are result_id,student_id,marks.
i will store added marks result table but I don't how to perform addition of marks of particular student and store in integer variable

example i want perform addition of marks where student_id=1

推荐答案

INSERT INTO RESULTS(total)VAlues( select SUM(Marks) from Results Where Student_Id=1)


这篇关于添加特定列的值并存储在特定变量中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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