ITPub博客

首页 > IT职业 > > 各位大大求助 为什么不能加别名,一加别名就报未找到from关键字

各位大大求助 为什么不能加别名,一加别名就报未找到from关键字

作者:ghost_hand 时间:2019-04-16 15:38:06 0 删除 编辑

select a.s# ,a.sname,
       sum(decode(c.cname,'语文',s.score,0)),
       sum(decode(c.cname,'数学',s.score,0)),
       sum(decode(c.cname,'英语',s.score,0)),
       avg(s.score)
from stu a,cou c,sc s where a.s# = s.s# and c.c# = s.c# 
group by a.s#,a.sname order by avg(s.score) desc

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1059/viewspace-3126448/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-15

  • 博文量
    81
  • 访问量
    444