IN Keyword

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
gastonlm
Forum Commoner
Posts: 26
Joined: Tue May 07, 2002 10:19 am
Location: Buenos Aires, Argentina
Contact:

IN Keyword

Post 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)
User avatar
enygma
Site Admin
Posts: 175
Joined: Fri Apr 19, 2002 8:29 am
Location: Dallas, Tx

Post by enygma »

what kind of database? MySQL doesn't support subselects yet...
gastonlm
Forum Commoner
Posts: 26
Joined: Tue May 07, 2002 10:19 am
Location: Buenos Aires, Argentina
Contact:

Post 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.
User avatar
enygma
Site Admin
Posts: 175
Joined: Fri Apr 19, 2002 8:29 am
Location: Dallas, Tx

Post by enygma »

so one select, get the results, use those results in the next one....
gastonlm
Forum Commoner
Posts: 26
Joined: Tue May 07, 2002 10:19 am
Location: Buenos Aires, Argentina
Contact:

Post by gastonlm »

I've solved. Thanks for all.
Gaston.
Post Reply