Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 13 Jan 2000 @ 21:27:07 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Nested Left Joins
 
From:   Mary Lou Arundell

I have three tables to join to create V1. (Student demographics plus info for the most recent term enrolled.)

T1 is my driver table; I need to retain all the records. It has C1. (Student demographic data/ ID).

T2 has C1 and C2. (Student Term data/ ID and term number)

T3 has C1 and C2. (Student Max Term/ ID and max term number)

Not every record in T1 has a match in T2. (Not every student enrolls each term) Every record in T2 will match a record in T3 on C1 and C2. (If they have a Max term number, they have a term record with that number.)

I tried:

     Replace View V1 ( .....) As Select (......)
     From T1 left outer join T2 on C1,
              T3
     where T2.C1 = T3.C1 and T2.C2 = T3.C2;

but this enforced an inner join between all three tables.

I could do my left outer join between T1 and T2 into V1, then do another left outer join between V1 and T3 into V2.

Can anyone tell me if I can write a join to do what I need between these three tables when creating V1?


Thanks very much.

Mary Lou Arundell
Database Systems Analyst
University of Cincinnati



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016