Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query question
Message
De
19/05/2006 19:54:44
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Query question
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Divers
Thread ID:
01123711
Message ID:
01123711
Vues:
48
Hi All

I have a contacts system that has four tables, Names, address, phonenumber, email. The last three have a nameFK foreign key that joins with the names table. I designed it this way so I could have multiple entries of each time of contact info. I have two rows in address, three rows in phonenumber and two rows in email. I am trying to create a query that will give me three rows (rows in phonenumber). What I am getting is 18. Is there a way to do this or am I going to need to redesign the tables. I am using Syabase ASA database.

Here is my Query. Thanks.
select  * 
from   names na
left outer join address ad
on ad.namefk = na.namepk
left outer join email em
on em.namefk = na.namePK
left outer join phonenumber  ph
on ph.namefk = na.namePK
where  na.namepk= 1
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform