Re: including the result of one query in another query
| From: | Brian V Bonini | Date: | Sun, 26 Jun 2005 11:53:16 +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-217645@lists.php.net to get a copy of this message | ||
On Sun, 2005-06-26 at 06:38, 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');
I believer DISTINCT is not an SQL function, it's a statement.
SELECT DISTINCT column_name FROM table_name;