Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 25 May 2011 @ 10:11:36 GMT


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


Subj:   Re: OLAP function and tracking data changes
 
From:   Shamim.Zaman

Alan,

Please use the following query, hope this helps!

     SELECT

      field1
     ,field2
     ,field3
     ,MIN(start_date) OVER
     (
        PARTITION BY Field1
              ,field2
              ,field3
        ORDER BY ''
     )
     ,MAX(end_date) OVER
     (
        PARTITION BY Field1
              ,field2
              ,field3
        ORDER BY ''
     )
     FROM < Table Name >

     QUALIFY

        ROW_NUMBER() OVER

     (
        PARTITION BY Field1
              ,field2
              ,field3
        ORDER BY ''
     ) = 1

Warm Regards,

Shamim



     
  <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