Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 29 Jun 2003 @ 09:21:31 GMT


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


Subj:   Re: How to fetch specific number of rows
 
From:   Dieter N�th

Rohitash Saini wrote:

  Can anyone tell me how to fetch specific number of rows from a table in Teradata. suppose I want to select only 5 records from a table , then what will be query in Teradata I am at learning stage in Teradata.  



select * from tab sample 5;

Look for the SAMPLE clause in SQL Manual 4 to return random rows: you can use an absolute number (sample 5 --> 5 rows) or a percentage (sample 0.01 --> 1% of the rows) and request more than one sample.


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