Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sat, 01 Oct 2011 @ 14:23:10 GMT


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


Subj:   Re: Need a help in the logic of query
 
From:   DUELL, BOB

Hard to tell, but this might work:

     SELECT  T0300.Acc_No  as DealId
           , a.Acc_No      as Portfolio
           , b.Acc_No      as Instrument

     FROM T300_AGREEGEMENT T300

     INNER JOIN T309_ACC_ACC_RELATIONSHIP a
     ON  T300.Acc_No = a.Related_Acc_No
     AND T300.Acc_Modifier_No = a.Related_Acc_Modifier_No
     AND a.Acc_Relationship_Type_Cd = 'Part_Deal'

     INNER JOIN T309_ACC_ACC_RELATIONSHIP b
     ON  T300.Acc_No = a.Related_Acc_No
     AND T300.Acc_Modifier_No = b.Related_Acc_Modifier_No
     AND b.Acc_Relationship_Type_Cd = 'Scrty_Of'

     ORDER BY 1 DESC


     
  <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: 15 Jun 2023