all groups > sql server data warehouse > june 2004 >
You're in the

sql server data warehouse

group:

How to find Rank(return Top 3 Country)



How to find Rank(return Top 3 Country) K.Senthil Kumar
6/29/2004 8:39:01 PM
sql server data warehouse: Hi All,

These are the records I've in my table. I need to return top 3 countries (rank) by Sales.

Record Date Country Sales
1 01.01.04 AU 80%
2 01.01.04 IN 92%
3 01.01.04 CH 50%
4 01.01.04 USA 75%
5 01.01.04 SG 25%


The result set should be:

Record Date Country Sales
2 01.01.04 IN 92%
1 01.01.04 AU 80%
4 01.01.04 USA 75%

How to write query for that?

Thanx
Rgds
Re: How to find Rank(return Top 3 Country) Jacco Schalkwijk
6/30/2004 11:09:16 AM
SELECT TOP 3 Record, Date, Country, Sales
FROM your_table
ORDER BY Sales DESC

--
Jacco Schalkwijk
SQL Server MVP


"K.Senthil Kumar" <K.Senthil Kumar@discussions.microsoft.com> wrote in
message news:6EB6A9BF-7A6D-4B10-8F9D-CC9087946489@microsoft.com...
[quoted text, click to view]

AddThis Social Bookmark Button