Archives of the TeradataForum
Message Posted: Wed, 09 Jan 2002 @ 07:50:10 GMT
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
|