Re: including the result of one query in another query
| From: | Burhan Khalid | Date: | Mon, 27 Jun 2005 08:06:33 +0000 |
| Subject: | Re: including the result of one query in another query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-217675@lists.php.net to get a copy of this message | ||
Pedro Quaresma de Almeida wrote:
Hi I have two databases, on for aeromodelistas (aeromodelling) and another for Códigos Postais (Postal Codes). I whant to do the following query SELECT CódigoPostal FROM Aeromodelistas WHERE CódigoPostal IN (SELECT distinct(CP4) FROM codigopostal.LOCART,codigopostal.DISTRITO WHERE codigopostal.LOCART.DD=codigopostal.DISTRITO.DD AND codigopostal.DISTRITO.DESIG='Coimbra'); This query is not working, and I do not know why. If I try the two queries individualy they work, togheter they don't!?Firstly, this is not PHP related. If you are using MySQL, you should know that sub-selects are only supported in versions 4.1 and above.