Hello,
I have recently converted my Java Servlets to run against mySQL where previously I was
using Microsoft Access. I use Tomcat and have swapped drivers etc and everything works
fine, more or less. However, I have one big problem which is as follows :-
My servlet software dynamically builds SQL of the following form, which to my
knowledge is fairly standard :-
-------------------------------------------------------------
Query is: select * from service where ((primary_category in (select sub_category
from category where sport = 1 )));
java.sql.SQLException: Syntax error or access violation: You have an error in yo
ur SQL syntax near 'select sub_category from category where sport = 1 )))' at li
ne 1
-------------------------------------------------------------
The text above is copied directly from some diagnostics on my Tomcat console.
If I use exactly the same query from phpMyAdmin I get exactly the same error so it's
not my JDBC driver that's at fault.
Why won't mySQL let me use this construct ?
Many thanks.
Jon Green.