Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 03 May 2006 @ 22:07:47 GMT


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


Subj:   Difference in row counts while using subquery
 
From:   Kodumur, Gopi

Any explanations why this happens

Eg :

     SELECT
      A.C1
     ,A.C2
     ,A.C3
     ,A.C4
     ,SQ.C5
     ,SQ.C6
     ,SQ.C7
     FROM
     (   SELECT
          C5
          ,C6
          ,C7
         FROM B JOIN C
         ON ( B.XYZ=C.TYD )
        QUALIFY ROW_NUMBER () OVER ( PARTITION BY C8,C9, ORDER BY C10  ) = 1
      )
     SQ JOIN  A
      ON ( SQ.C6=A.C11)

Row count are changing each time we execute.

Other approach we took was to create a volatile table of the sub query and use it in the main Query, results are consistent.


Thanks,

Gopi



     
  <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