51Testing软件测试论坛

标题: sql查询,帮忙解决下 [打印本页]

作者: fish1689999    时间: 2012-6-27 19:25
标题: sql查询,帮忙解决下
[attach]79728[/attach]
作者: 如果弯弯    时间: 2012-6-28 12:46
本帖最后由 如果弯弯 于 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
回复 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
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_no  group by t2.sc_no ;
作者: q315585646    时间: 2012-7-4 09:31
不错不错




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2