Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL
Message
From
10/10/2000 12:55:57
 
 
To
10/10/2000 12:47:00
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Re: SQL
Miscellaneous
Thread ID:
00427381
Message ID:
00427392
Views:
15
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
Previous
Reply
Map
View

Click here to load this message in the networking platform