gvamsimba
asked on
finding top 3 rows without using partion or any functioni
HI , Below is my code which gives me top 3 brands based on volume by country....code is running fine..
but my manager wants to get the same output WITHOUT using any Partion or any other special functions..
is it possible to re-write this query without them ?
Many thanks
but my manager wants to get the same output WITHOUT using any Partion or any other special functions..
is it possible to re-write this query without them ?
Many thanks
select * from (
select brand,country,sum(Volume)a
s vol,
row_number() over (partition by country order by sum(volume) desc) r
from Table
group by brand, country
) sq
where sq.r <= 3
order by country
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
good..the second part of the solution has given me what i want...cheers..
Open in new window