I am developing web application using JSP and Servlet (IDE: Eclipse, Container: Tomcat7.0, DB: Oracle 10)
I want to get data from two table in a single query
Query:
query = "select * from PROTOCOL as a, ACTIONS as b where a.PROTOCOL_ID = b.PROTOCOL_ID";
But after running the application I am getting the following exception:
java.sql.SQLException: ORA-00933: SQL command not properly ended
is there anything wrong in query?
The problem you have is keyword
AS. This is used for columns inSELECTsection. It is not valid forFROMwhere you specify the tables.You have
select * from PROTOCOL as a, ACTIONS as bshould be
select * from PROTOCOL a, ACTIONS b...From Oracle Docs
Example: