Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 09 Jan 2002 @ 07:50:10 GMT


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


Subj:   Re: Ranking within dimensions
 
From:   John Street

If you have V2R4 then you can use the window flavour of Rank

To rank salespersons by sales region based on their sales, the following SQL query:

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


Cheers

John Street
Senior Principal Consultant,
Relationship Technology Solutions for Financial Services,
NCR Limited



     
  <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