Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 28 Jul 2004 @ 18:19:39 GMT


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


Subj:   Re: How to make use of distinct option with count window function.
 
From:   Michael Larkins

Good place for a derived table:

     sel  div,  cd1, typ , count(id)  over (partition by div, typ rows
       between unbounded preceding and unbounded following) as lvltyp  ,
       count(id)  over (partition by div, typ , cd1 rows between unbounded
       preceding and unbounded following) as lvlcd
       from (sel  div,  cd1, typ ,id from t1 group by 1,2,3,4) dt;

Hope this helps,

Michael Larkins
Certified Teradata Master



     
  <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