fish1689999 发表于 2012-6-27 19:25:17

sql查询,帮忙解决下

如果弯弯 发表于 2012-6-28 12:46:14

本帖最后由 如果弯弯 于 2012-6-29 13:21 编辑

a) update score set sc_sco=sc_sco+10 where sc_no='345';
b) select a.st_no,a.st_name from STUDENT a,score b
    where a.st_no = b.sc_stno and b.sc_no='123' and b.sc_sco>80;
c)select a.st_no,a.st_name ,a.st_age,b.sumsco
   from STUDENT a,(select sc_stno ,sum(sc_sco) as sumscore from score group by sc_stno) b
   where a.st_no=b.sc_stno;

喝少了想上树 发表于 2012-6-29 00:17:33

回复 1# fish1689999
a)update score set sc_sco=sc_sco+10 where sc_no=345
b)select t1.st_no,t1.st_name from student t1,score t2 where t1.st_no=t2.sc_stno
and t2.sc_no=123
and t2.sc_sco>80

喝少了想上树 发表于 2012-6-29 09:04:35

a)update score set sc_sco=sc_sco+10 where sc_no=345
c)select t1.st_no,t1.st_name,sum(t2.sc_sco)from student t1,score t2 where t1.st_no=t2.sc_nogroup by t2.sc_no ;

q315585646 发表于 2012-7-4 09:31:15

不错不错
页: [1]
查看完整版本: sql查询,帮忙解决下