请教sql语句?谢谢 题目写得不是很清楚 select a.name,b.id,sum() from student a,notes b group by b.id,a.name 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你在表中必须为月份建立一个字段month,与成绩联系起来,不然怎么知道该成绩是属于那一个月的,那如何统计哪三个月的成绩?select name,sum() from student a, b where a.id=b.id and month>=1 and month<=3 select student.name as 学生,sum() as 三个朋分数和from student,noteswhere student.id=notes.idgroup by student.name; 同意caoruomou(caoruomou)的意见是哪个月的月考分数?应该在表中建立相应字段加以区别这样统计三个月的时候就可以相应提取group by如果不声明就像jackshs(jack_shi)说的那样,直接group by name即可 另一个:select t1.id as 学生, t1.sumMark as 三个月分数和from (select id ,sum() sumMark from notes group by id) t1, student t2where t1.id = t2.id 那就像楼上说的,表join一下,对id做group by 就好了select max(s.name),s.id,sum(n.) from students s , notes nwhere s.id = n.id group by s.id 有没有办法记录数据库所有用户的imp,drop,truncate,delete操作 内存数据库的问题 女孩适合学习oracle吗 Union ALL 中不让Order by VB.NET连接ORACEL出现的问题 求助 。。。oracle 同期 同比 环比 请问这个功能如何在oracle中实现.解决后马上给分 oracle 函数调用外部jar包 问个比较菜的问题,请问如何返回增量型字段的值? 有没有办法在没有网卡的计算机上启动TNS 关于WHERE条件等于空的问题,请帮忙,急~~~~ 请问oracle中能使用case...when...then...end吗?
select name,sum() from student a, b where a.id=b.id and month>=1 and month<=3
from student,notes
where student.id=notes.id
group by student.name;
是哪个月的月考分数?应该在表中建立相应字段加以区别
这样统计三个月的时候就可以相应提取group by如果不声明就像jackshs(jack_shi)说的那样,直接group by name即可
select
t1.id as 学生,
t1.sumMark as 三个月分数和
from
(select id ,sum() sumMark from notes group by id) t1,
student t2
where
t1.id = t2.id
where s.id = n.id
group by s.id