Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax fo SELECT with several OUTER JOINs (VFP 5)?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00140952
Message ID:
00141025
Views:
34
>I have a main table (schedule) with several (6) look-up tables (location, category, contact, ...).
>
>They are related by key fields (schedule.loc_id -- location.loc_id, etc.) The schedule table does not necessarily have these fields entered (the client wants them optional).
>
>What is the syntax for several outer joins with SELECT? I took a shot at it with the query builder, but it doesn't retrieve the right data either.

Here's one I wrote last night:

select mbr_pk, due_mbr_fk, mbr_snameck, due_date, typ_nameck from ;
Members left outer join Dues on due_mbr_fk == mbr_pk ;
left outer join Types on due_typ_fk == typ_pk ;
order by mbr_snameck

Each field is prefixed by the table name abbreviation. PK stands for primary key; fk for foreign key. A Member can have zero or many Dues and a Dues has a Type.

This will produce .NULL. for due_mbr_fk, due_date and typ_nameck if a Member has no Dues.
Previous
Reply
Map
View

Click here to load this message in the networking platform