oracle SQL 错误:ORA-00933:SQL 命令未正确结束 00933.00000 -“SQL 命令未正确结束”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36706780/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:13:02  来源:igfitidea点击:

SQL Error: ORA-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly ended"

sqloracle

提问by D. Romanski

I have looked through this site and cannot find a similar scenario. I am trying to run the following code

我浏览了这个网站,找不到类似的场景。我正在尝试运行以下代码

SELECT st.storeid, s.noofitems
FROM salestrnsaction AS st, soldvia AS s
WHERE st.tid = s.tid
ORDER BY noofitems ASC;

and am still receiving the 'SQL command not properly ended' error.

并且仍然收到“SQL 命令未正确结束”错误。

More specifically, this is the message I am receiving.

更具体地说,这是我收到的消息。

SELECT st.storeid, s.noofitems
FROM salestrnsaction AS st, soldvia AS s
WHERE st.tid = s.tid
ORDER BY noofitems ASC
Error at Command Line : 287 Column : 22
Error report -
SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 -  "SQL command not properly ended"
*Cause:    
*Action:

Thanks.

谢谢。

回答by brenners1302

You are using ORACLE right?Using ASin alias in FROM Clause is not valid in Oracle. Please refrain from using AS in giving aliases to tables.

您使用的是 ORACLE 对吗?AS在 FROM 子句中的别名中使用在 Oracle 中无效。请避免使用 AS 为表提供别名。

Just write the alias after the table.

只需在表后写别名。

SELECT st.storeid, s.noofitems
FROM salestrnsaction st, soldvia s
WHERE st.tid = s.tid
ORDER BY s.noofitems ASC;

回答by RonniBrown

My issue was a little bit different. I was just performing a simple SELECTand got the same error.

我的问题有点不同。我只是在执行一个简单的操作SELECT,却遇到了同样的错误。

SELECT *
-- Inventory
FROM EQUIPMENT as EQP

What I discovered from the research I did is the ASis not needed for Oracle SQL vs MySQL, so when I changed to the query to...

我从我所做的研究中发现ASOracle SQL 与 MySQL 不需要,所以当我将查询更改为...

SELECT *
-- Inventory
FROM EQUIPMENT EQP

this eliminated the error.

这消除了错误。