I have the following query for my oracle database that consists of two seperate queries :
ResultSet rs2 = st2.executeQuery("select * from user_col_comments where substr(table_name,1,3) !="+ "'TCT' and substr(table_name,1,4) != 'ARTZ' and (table in user_tables where secondary='N') ");
This compiles ok within my Java jdbc code. But when I run it, I get the following error:
java.sql.SQLSyntaxErrorException: ORA-00936: missing expression
I'm aware that the second part of this query doesn't work:
(table in user_tables where secondary='N')
I don't understand why it doesn't work as I'm a complete newbie. And I don't know how to do it right. I checked this here. But I don't think it gives me what I want. I would like to combine these two queries, so that I get all user_col_comments
whose table is within user_tables