Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 27 Apr 2004 @ 22:00:14 GMT


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


Subj:   Re: Conditional max
 
From:   Maxwell, Donald

Correction, I missed the ROWS UNBOUNDED PRECEDING ...

The correct statement should be:

     SELECT
             ,PARENT
             ,CHILD
             ,AMT
     FROM    SomeTable
     QUALIFY SUM(1) OVER ( PARTITION BY PARENT
             ORDER BY AMT desc, CHILD desc ROWS UNBOUNDED PRECEDING ) = 1;

Donald Maxwell



     
  <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