Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 24 May 2005 @ 12:23:08 GMT


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


Subj:   Re: Group by on one column but select multiple columns
 
From:   Hassinger, Bill

Use can try the rank function to identify the most recent last_dt.

     select emp_name, emp_id, last_dt
     from employee K1
     QUALIFY RANK(last_dt) = 1;

You may have to use (last_dt DESC) to get the max date, I always have to play with it to get the dates in the order I want.



     
  <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