Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 28 Oct 2008 @ 14:17:11 GMT


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


Subj:   SAMPLE Command to obtain 5 per location
 
From:   Phil.Oldfield

I have a table that has a location reference and customer account no's

I need SQL/Macro/Procedure that can sample 5 customer account no's per location without needing to use

     SAMPLE
     WHEN location = 1 then 5
     WHEN location = 2 then 5
     etc.

I was thinking of a procedure to insert each sample of 5 into a table using a cursor but you can only insert single rows in a procedure

Any help appreciated


Phil Oldfield
Iceland Foods



     
  <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