Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 14 Apr 2004 @ 10:49:52 GMT


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


Subj:   Re: Selecting records with Max Date
 
From:   Henry Runn

Hi,

Try this one:

     Select target from table
     where definition in (42,44,55)
     group by definition
     qualify rank (date desc)=1

last top10 targets you get by following clause:

     Select target, date from table
     where definition in (42,44,55)
     group by definition
     qualify rank (date desc)<=10

Thanks Henry



     
  <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