数据库查询标记总和 [英] Data Base Query sum of marks

查看:57
本文介绍了数据库查询标记总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每日考试



Daily exam

Student_id--   Marks --   Date 
  1--	      10  --     30/01/2012
  1           20       25/01/2012
  1           10       20/01/2012
  1           40       11/01/2012
  2	      30       30/01/2012
  2           60       25/01/2012
  2           90       20/01/2012
  2           50       11/01/2012

  1	      20       30/02/2012
  1           20       25/02/2012
  1           10       20/02/2012
  1           40       11/02/2012
  2	      30       30/02/2012
  2           60       25/02/2012
  2           20       20/02/2012
  2           50       11/02/2012



i想要出售像



每月wice意味着输出与From Date和date作为输入的参数




i want out put like

Monthly wice means out put like with parameters of From Date and to date given as inputs

Student_id   Marks    Date 
   1          80       jan 2012
   2          230      jan 2012
   1          90       feb 2012
   2          160      feb 2012





如果

年度wice意味着像参数为From Date和日期作为输入





if
Yearly wice means out put like with parameters of From Date and to date given as inputs

Student_id   Marks    Date 
   1          160       2012
   2          390      2012









任何人请帮帮我



[edit]已添加代码块 - OriginalGriff [/ edit]





any one please help me

[edit]Code block added - OriginalGriff[/edit]

推荐答案

您可以使用SUM(标记)和GROUP BY年份([日期]),月份([日期]),学生_ID



试一试。



祝你好运!
You can SUM(marks) and GROUP BY Year([Date]), Month([Date]), Student_id

Just give it a try.

Good luck!


这篇关于数据库查询标记总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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