Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 28 Oct 2003 @ 10:21:38 GMT


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


Subj:   Re: Is there any system column like the Oracle RowNum in Teradata?
 
From:   Agarwal, Rishi

ROW_NUMBER() function can be used to get a sequence number in teradata.

For example:

SELECT ROW_NUMBER() OVER (PARTITION BY sales_region
ORDER BY sales_amount DESC),
sales_person, sales_region, sales_amount
FROM sales_table;

'PARTITION BY' is optional. If there is no PARTITION BY clause,then the entire result set, specified by the ORDER BY clause, constitutes a single group, or partition.


Thanks

Rishi



     
  <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