ORA-00905: 缺少关键字错误 oracle
Posted
技术标签:
【中文标题】ORA-00905: 缺少关键字错误 oracle【英文标题】:ORA-00905: missing keyword error oracle 【发布时间】:2015-06-08 17:15:11 【问题描述】:嗨,当我尝试执行 oracle
查询时,我得到了
[Err] 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" ;
【问题讨论】:
【参考方案1】:最可能的问题是MJNSXJJRW AS S0
。在定义列别名时使用AS
关键字,而不是在定义表别名时。
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"
是一列,而不是字符串文字。如果是后者,则应使用单引号。
【讨论】:
感谢艾伦,它确实帮助我解决了这个问题。以上是关于ORA-00905: 缺少关键字错误 oracle的主要内容,如果未能解决你的问题,请参考以下文章
无法更正 Oracle 错误 ORA-00905 SQL 中缺少关键字