ORA - 00933混淆内部联接,并“为”(ORA - 00933 confusion wit

2019-08-31 14:26发布

我有两个表使用获取数据的这个查询inner join ,但我得到的错误SQL command not properly ended与下一个星号“是”:

select P.carrier_id, O.order_id, O.aircraft_id, O.quantity

from orderline AS O

inner join purchaseorder AS P

on O.order_id = P.carrier_id;

the error:

from orderline AS O ( with an asterix under AS)


Error at line 2
Ora-00933: SQL command not properly ended.

在关于这一点,我认为, AS不会是一个问题,因为它只是引用的别名,但我很困惑,为什么这就要到了。

Answer 1:

只是删除了AS关键字

select 
   P.carrier_id, 
   O.order_id, 
   O.aircraft_id, 
   O.quantity
from 
   orderline O
inner join purchaseorder P
   on O.order_id = P.carrier_id;


Answer 2:

你不允许插入关键字as表名和别名之间。



文章来源: ORA - 00933 confusion with inner join and “as”