This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Mysql query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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!
I agree. Here's the link:
subject: Mysql query
Similar Threads
how to improve performance
MySQL Query
how to get child table values from parent query
Query help
How can we use query containing two or more tables!