Page 1 of 1

IN Keyword

Posted: Wed May 22, 2002 9:06 am
by gastonlm
Hi, I'm trying to run the following query to obtain all the cities in a country. But it return an error. How can I do it?
Select * FROM city WHERE countryID IN(SELECT * FROM coutry WHERE ID=1)

Posted: Wed May 22, 2002 9:28 am
by enygma
what kind of database? MySQL doesn't support subselects yet...

Posted: Wed May 22, 2002 9:40 am
by gastonlm
aaahhhh, I didn't know that. I'm using MySql but I'm new to php.
Do you know any way to do a subselection? I'll think another anyway.

Posted: Wed May 22, 2002 11:45 am
by enygma
so one select, get the results, use those results in the next one....

Posted: Wed May 22, 2002 11:48 am
by gastonlm
I've solved. Thanks for all.
Gaston.