Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 31 Dec 2003 @ 16:57:02 GMT


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


Subj:   Re: FIRST and LAST value question
 
From:   jim.bagley

For the last mebership date for each customer -

     select  *
              from MEMBERSHIPS
           group by  CUST_ID
     qualify rank(MEMBERSHIP_DATE DESC) = 1

For the first mebership date for each customer -

     select  *
         from MEMBERSHIPS
           group by  CUST_ID
     qualify rank(MEMBERSHIP_DATE ASC) = 1


     
  <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