Re: Can't get my query right!!

From: chris <cys4_at_columbia.edu>
Date: 1997/08/07
Message-ID: <33E9EEE3.B096B1A9_at_columbia.edu>#1/1


David Fabi wrote:

> Hello,
>
> I'm having some problems in defining my query.
>
> Here's a simplified version of my problem
>
> I have two tables
>
> Name Key Key Adresse
> ------------- -----------------
> John 1 1 Montreal
> Micheal 2 1 New-York
> Peter 3 1 Berlin
> 2 London
> 2 Paris
> 3 Hong Kong
>
> I wish to match each Name with one of its adresses.
>
> The resulting query should be something like
>
> John 1 1 Montreal
> Micheal 2 2 London
> Peter 3 3 Hong Kong
>
> It does look simple, but I don't seem to find the trick...
>
> Thanks
> --
> David Fabi
> Agent Technique, Services Informatique
> Centre de Recherche Informatique de Montréal (CRIM)
> 1801, avenue McGill Collège, bureau 800
> Montréal (QC) H3A 2N4,
> Télephone : (514) 840-1235 poste 2387
> Télécopieur : (514) 840-1244
> Internet : dfabi_at_crim.ca

   Try this:

SELECT NAME.NAME, NAME.KEY, ADDRESS.ADDRESS

FROM       NAME, ADDRESS
WHERE     NAME.KEY = ADDRESS.KEY;

good luck.

Christopher Suh Received on Thu Aug 07 1997 - 00:00:00 CEST

Original text of this message