Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

sql

oracle

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.

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.

like image 368
D. Romanski Avatar asked Apr 19 '16 01:04

D. Romanski


People also ask

Why am I getting SQL command not properly ended?

The message ORA-00933: sql command not properly ended. This error is usually caused by an SQL statement with a clause that is not allowed for that statement. Some examples that might cause this error are: An INSERT statement with an ORDER BY clause or an INNER JOIN.

How do you end a SQL command?

You can end a SQL command in one of three ways: with a semicolon (;) with a slash (/) on a line by itself. with a blank line.

How do you resolve ORA 00942 table or view does not exist?

You may be seeing the Ora-00942 error because you are referencing a table or view in a schema which you did not create but one that is in another schema. To correctly execute the query from another schema, you must reference the table by the schema name.

What is missing expression error in SQL?

The ORA-00936 message is a missing expression error in Oracle. All that 'missing expression' means is that When attempting to operate a query, a particular part of the clause necessary for it to function was omitted in the text. Stated simply, you left out an important chunk of what you were trying to run.


1 Answers

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

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;
like image 197
brenners1302 Avatar answered Oct 05 '22 13:10

brenners1302