我正在使用具有临时关系的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;
由于
答案 0 :(得分:20)
oracle不支持as
表别名,仅支持列别名,并且它们对于该用途是可选的=>删除所有as
个关键字;)
答案 1 :(得分:7)
你不应该把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;
致以最诚挚的问候,