Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Right outer join from 3 tables
Message
From
11/08/2000 16:20:14
 
 
To
11/08/2000 16:07:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00404126
Message ID:
00404135
Views:
15
Sounds like you need a LEFT outer join. e.g.,
SELECT t1.field1, t1.field2, t1.field3 as field1_3, ;
  t2.field3 as field2_3 ;
  from table1 t1 ;
  left join table2 t2 ;
    on t1.field1 = t2.field1 ;
  left join table3 t3 ;
    on t3.field1 = t3.field1 ;
  into cursor cu_results
>I want to get data from 3 tables. Want all records in table 1, records in table 2 that are in
>table 1 and records in table 2 that are in table 1. Because of way data was created all 3
>tables have the same field names for equivalent fields. I assumed I need to use a right
>outer join. For table 1 and 2 I used
>
>select 1.a, 1.b, 1.c, as x, 2.c as y from 1 ;
> join 2 ;
> on 1.a = 2.a and 1.b = 2.b ;
> into cursor c1
>
>This gives records in table 1 and table 2, can do a similar request for table 1 and 3.
>How do I records in 1 with matching records in table 2 and matching records in 3?
>
>If possible I would also like null fields to be returned as blanks.
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform