Posted by amit.vasu on 10/26/06 13:44
Hello
I am using sql server 2005.
I have two tables as described below.
Table1
UserID UserSales
---------------------
1 10
2 13
3 17
4 19
5 21
6 10
7 12
8 11
9 31
10 23
11 24
12 10
13 16
Table2
UserID Country
----------------------
1 Canada
2 Canada
3 Canada
4 Canada
5 Canada
6 USA
7 USA
8 USA
9 USA
10 USA
11 UK
12 UK
13 UK
I want to get top 2 UserSales for each country and remaining should be
displayed as Total as Others for that country.
Can someone please help me with this query?
Regards
Amit
[Back to original message]
|