Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 06 Dec 2012 @ 13:21:35 GMT


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


Subj:   Re: Selecting a part of a table
 
From:   Gregg, William

Hi James - use the SAMPLE function to generate a random sample of a fixed number of rows or a percentage of the rows.

1) Fixed Nbr:

     Select *
     From dbnm01.tblnm01
     Sample 100000    --Selects 100000 rows from the answerset ;

2) Percentage

     Select *
     From dbnm01.tblnm01
     Sample .10            --Express the percentage as a decimal ;

Since the result set is randomly selected, U are unable (well actually, almost never able) to duplicate the answer set by rerunning the query.


Rgrds,

Bill Gregg



     
  <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