I once noticed the error code "ORA-00933: SQL command not properly ended" while working on a project that required creating SQL queries in an Oracle database.
The problem occurred when I attempted to utilise the WITH clause in my SQL query to construct a Common Table Expression (CTE). The inquiry was written as follows:
When I attempted to run the query, however, I received the following error message:
This error notice perplexed me because the syntax of my query appeared correct to me. So, I read this, which suggested changing the query in order to avoid utilizing the column alias in that subquery. Is that correct? I don't think this could work. Can someone help me out?
The problem occurred when I attempted to utilise the WITH clause in my SQL query to construct a Common Table Expression (CTE). The inquiry was written as follows:
WITH my_cte AS ( SELECT * FROM my_table ) SELECT * FROM my_cte WHERE id = 1;
ORA-00933: SQL command not properly ended