Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mysql query

 
sean zang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 table1.id=table2.id) "
Does any JDBC expert tell me how to replace those queries with MYSQL statements?
Sean
thanks in advance
 
SoonAnn Lim
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, this is the answer i think it works.
SELECT table1.* FROM table1 LEFT JOIN table2 ON table1.id=table2.id where table2.id IS NULL;
You can find this on Mysql homepage.
 
sean zang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,SoonAnn Lim
thanks for you reply !
I have alrady solved by coding in JDBC
Sean
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sean zang,
Please post your code so us others can learn!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic