Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT records from 3 tables
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00394522
Message ID:
00394537
Views:
15
You are using INNER JOINS. Unless records show up in both the recall and telelist tables, you won't see either. Change the JOINS to LEFT OUTER to pick up all patients with recalls or telelist entries.

HTH.

>I would like to collect all appointments, recalls, and telephone messages for a single patient into a single cursor. The relational item is the common patient.
>
>SELECT *field list* ;
> FROM patient ;
> JOIN recall ON patient.on+patient.pn = recall.cnpn ;
> WHERE PATIENT.on+patient.pn = '01450601' ;
>
>collects 3 records from the recall table
>
>
>SELECT *field list* ;
> FROM patient ;
> JOIN recall ON patient.on+patient.pn = recall.cnpn ;
> JOIN telelist ON patient.on+patient.pn = telelist.cnpn ;
> WHERE PATIENT.on+patient.pn = '01450601' ;
>
>Collects 0 records - Is this the correct type of JOIN for the 3rd table?
>
>Thanks in advance for your time.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform