我查看了这个网站,找不到类似的场景.我试图运行以下代码
SELECT st.storeid, s.noofitems
FROM salestrnsaction AS st, soldvia AS s
WHERE st.tid = s.tid
ORDER BY noofitems ASC;
Run Code Online (Sandbox Code Playgroud)
并且仍然收到'SQL命令未正确结束'错误.
更具体地说,这是我收到的消息.
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:
Run Code Online (Sandbox Code Playgroud)
谢谢.
您正在使用ORACLE吗?AS在FROM Clause中使用别名在Oracle中无效.请不要使用AS来为表格提供别名.
只需在表格后面写下别名即可.
SELECT st.storeid, s.noofitems
FROM salestrnsaction st, soldvia s
WHERE st.tid = s.tid
ORDER BY s.noofitems ASC;
Run Code Online (Sandbox Code Playgroud)