Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 17 Jul 2006 @ 22:41:24 GMT


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


Subj:   Re: How to get top N records
 
From:   Shrinivas.Sagare

Bhakti,

If your are on Teradata V2R6.0 and above then you can use "SELECT TOP N". Say you want to see top 25 records of your query then you can write it as

     SELECT TOP 25 FIELD1,
     FIELD2,
     SUM(FIELD3)
     FROM MYTABLE1
     WHERE
     
     GROUP BY 1,2
     ORDER BY 1,2 ASC,3 DESC

Thanks & Regards,

Shrinivas Sagare



     
  <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