IN clause

by cliper Saturday, July 05, 2008 8:39 PM

 

have some problems  with mysql. can't find the exact phrase from the MySQL Documentation about this. Anyway, one of the guy from asp.net forum ask some unusual question. I encounter this before and I don't want this to be a burden soon.

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

tried to execute this SQL statement  (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');

if anyone would like to share some of their ideas, you might like to refer me a site. you can use my contact page above. 


Cheers,

 

Tags:

MySQL

About the author

Author's PhotoI enjoy web developing and would like to share my thoughts of it.

Send mailE-mail me

Most comments

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar