ORA-00933: SQL command not properly ended
I am getting the ORA-933 error when I try to run a query in a pl/sql stored procedure. The same query works fine if I run it outside the procedure. Any reason why this could be happening?
The query has a Group By clause as it is using SUM function. If I remove the group by clause and the SUM function the procedure works but I had to change the order by join conditions in the WHERE clause.