MySQL Forums
Forum List  »  Newbie

IN clause
Posted by: Mark Neil Borromeo
Date: July 05, 2008 10:32AM

been having problems can't find the exact phrase from the MySQL Documentation about the syntax. Anyway, one of the guy from forum ask some unusual question. I encounter this before and I don't want this to be a burden when I have this problem when using MySQL.

In this, I use world.sql (sample db) from MySQL sample db's.

tried to execute this one (we need to test something. just made up something like this one):

SELECT Name FROM city GROUP BY Name HAVING MAX(`Population`) > 10000 LIMIT 20;

after that, we need to execute something like

DELETE FROM city WHERE Name IN(SELECT Name FROM city GROUP BY Name HAVING MAX(`Population`) > 10000 LIMIT 20);

Well, we can see a helpful message. :)
This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

thought of something to have the same.. and my last bet is to have a single line. like:

DELETE FROM city WHERE Name IN('name1', 'name2', 'name3');

Anyone would like to share some of their ideas?


Options: ReplyQuote

Written By
IN clause
July 05, 2008 10:32AM
January 01, 2009 09:49AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.