看看我的VF语句有什么错误

来源:百度知道 编辑:UC知道 时间:2024/06/21 20:01:38
select 学号,avg(成绩) as b from chengji group by 学号 where chengji.学号=xuesheng.学号 into cursor a
update xuesheng set 平均分=a.b where a.学号=xuesheng.学号
select * from xuesheng order by 平均分 asc,学号 asc into table pingjun
然后总是出错说 找不到列b,那怎么办啊?????那个as的不就是列B了吗?
表是没有问题。。。我的问题在于。
into cursor a 以后 我想用b列(就是avg(成绩))的那个。。 用不了列B

select 学号,avg(成绩) as b from chengji group by 学号 where chengji.学号=xuesheng.学号 into cursor a
应该改为:select chengji.学号,avg(成绩) as b from chengji,xuesheng group by 学号 where chengji.学号=xuesheng.学号 into cursor a
你的表达不是很清楚,我只能发现这么多,你再详细表达清楚一点

group by 短语一般情况下应该跟在where 短语后面
要弄明白还要知道你各张表的结构,从第一行的查询内容看,与xuesheng表没有关系,学号和成绩全在chengji表中了