Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 07 Jun 2005 @ 06:52:48 GMT


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


Subj:   Re: Question about SAMPLING
 
From:   Dieter Noeth

Hi Arun,

     select
        APP_NUM,
        REP_ID
     from
     (
        select
           APP_NUM,
           REP_ID,
           random(-200000000,+200000000) as r
        FROM TABLE T1
     ) dt
     qualify row_number() over (partition by REP_ID order by r) <= 5

I had to use a derived table, because random is not allowed within an OLAP function...


Dieter



     
  <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