Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
gastonlm
Forum Commoner
Posts: 26 Joined: Tue May 07, 2002 10:19 am
Location: Buenos Aires, Argentina
Contact:
Post
by gastonlm » Wed May 22, 2002 9:06 am
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)
enygma
Site Admin
Posts: 175 Joined: Fri Apr 19, 2002 8:29 am
Location: Dallas, Tx
Post
by enygma » Wed May 22, 2002 9:28 am
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 » Wed May 22, 2002 9:40 am
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.
enygma
Site Admin
Posts: 175 Joined: Fri Apr 19, 2002 8:29 am
Location: Dallas, Tx
Post
by enygma » Wed May 22, 2002 11:45 am
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 » Wed May 22, 2002 11:48 am
I've solved. Thanks for all.
Gaston.