File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Mysql query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Mysql query" Watch "Mysql query" New topic

Mysql query

sean zang
Ranch Hand

Joined: Apr 22, 2000
Posts: 33
Dear All;
MYSQL Query does not support following statements
" SELECT * FROM table1 WHERE id NOT IN (SELECT id FROM table2);
SELECT * FROM table1 WHERE NOT EXISTS (SELECT id FROM table2 where "
Does any JDBC expert tell me how to replace those queries with MYSQL statements?
thanks in advance
SoonAnn Lim
Ranch Hand

Joined: Jun 21, 2001
Posts: 155
Hi, this is the answer i think it works.
SELECT table1.* FROM table1 LEFT JOIN table2 ON where IS NULL;
You can find this on Mysql homepage.
sean zang
Ranch Hand

Joined: Apr 22, 2000
Posts: 33
Hi,SoonAnn Lim
thanks for you reply !
I have alrady solved by coding in JDBC
Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
sean zang,
Please post your code so us others can learn!
It is sorta covered in the JavaRanch Style Guide.
subject: Mysql query