SQL命令未正确结束



我正在使用一个具有Temporary关系的SQL语句,并得到错误ORA-009933: SQL command not properly ended

我认为这份声明没有任何错误,所以我们非常感谢您的帮助。声明是:

SELECT Temp.name,
       Temp.AvgSalary
FROM   (SELECT A.aid,
               A.aname       AS name,
               AVG(E.salary) AS AvgSalary
        FROM   Aircraft A,
               Certified C,
               Employees E) AS Temp; 

感谢

oracle不支持表别名的as,只支持列别名,并且它们是可选的=>删除所有as关键字;)

您不应该将AS临时。当将别名放入表(或子查询)时,您应该只写别名。这应该有效:

SELECT Temp.name, Temp.AvgSalary 
FROM ( SELECT A.aid, A.aname AS name, AVG(E.salary) AS AvgSalary 
       FROM Aircraft A, Certified C, Employees E)  Temp;

致问候,

相关内容

  • 没有找到相关文章

最新更新