Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 03 Nov 2015 @ 21:30:00 GMT


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


Subj:   Re: Generating Random Records
 
From:   Dempsey, Mike

How to do this may depend on your definition of 'random'.

Teradata fetches rows in parallel and does not sort them unless you tell it to. If you just fetch 'n' rows from a table - with no Order by or Where clause - those rows will effectively be random.

You can use "Select Top n ..."
Or "Select ... Sample n"

I don't think either of these performs any sorting so you should get an essentially random set of rows. (Check the docs for details just to be sure ... and maybe they will tell you which is better performance)


Mike Dempsey



     
  <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