10

我正在使用具有临时关系的 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; 

谢谢

4

2 回答 2

21

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

于 2012-03-21T19:45:57.197 回答
7

你不应该把 AS temp. 将别名放入表(或子查询)时,您应该只编写别名。这应该有效:

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;

最好的祝福,

于 2012-03-21T19:51:36.953 回答