嗨,当我尝试执行以下oracle
查询时,我正在
[错误] ORA-00905:缺少关键字
CREATE VIEW MJNSXJJRW_view AS
SELECT B.oID AS "_oid", B.oTm AS "_otm"
FROM
(SELECT DISTINCT oID, oTm FROM MJNSXJJRW) B
LEFT JOIN MJNSXJJRW AS S0 ON
B.oID = S0.oID AND
S0.idx = 0 AND
S0.kID = "str_val" ;
答案 0 :(得分:3)
最可能的问题是MJNSXJJRW AS S0
。在定义列别名时使用AS
关键字,而不是在定义表别名时使用。{/ p>
CREATE VIEW MJNSXJJRW_view AS
SELECT B.oID AS "_oid", B.oTm AS "_otm"
FROM
(SELECT DISTINCT oID, oTm FROM MJNSXJJRW) B
LEFT JOIN MJNSXJJRW S0 ON
B.oID = S0.oID AND
S0.idx = 0 AND
S0.kID = "str_val" ;
我假设"str_val"
是一列,而不是字符串文字。如果是后者,你应该使用单引号。