Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL
Message
De
10/10/2000 12:55:57
 
 
À
10/10/2000 12:47:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Re: SQL
Divers
Thread ID:
00427381
Message ID:
00427392
Vues:
17
Hi Robin,

Let's say you had two tables, agents and property. In property, you have a foreign key pointing to the agent for that property. Now you want all property rows for agents based in London. The foreign key in property is called fk_agent, and called pk in the agent table.
SELECT * FROM property ;
  WHERE fk_agent IN (SELECT pk FROM agent WHERE city="London")
See?



>I'm Ok with joins could somebody please
>explain the IN clause in SQL i.e
>
> Select fields from tables ;
> where variable in(select a from b) ;
> into cursor temp
>
>Thanks
>Rob
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform