SELECT table1.col1, table2.col2
FROM table1
WHERE col3
IN(SELECT col1 FROM table3 WHERE col4 IN(SELECT col4 FROM table4 WHERE col5 LIKE '%XYZ%'))
INNER JOIN table2 ON table1.col1=table2.col6
ORDER BY table1.col1
I get a ORA00933 error.SQL command not properly ended. If I remove the join, the query works perfectly. But i need the join. The error is near the LIKE keyword. How can I solve it?
You have misplaced the
INNER JOIN, it was located in yourWHEREclause.Note that you might want to adopt some formatting scheme for writing SQL Statements. It makes it much easier to spot these kind of errors.