ranking and filtering

Database

ranking and filtering

hello everyone ,

I would need your help to meet a certain scenario , primarily I would require to top five records based on value1 ,but in scenarios where value1 is same then I should consider value2 for filtering top5




rank value1 value2
1 10 11
2 20 21
3 30 41
4 40 41
5 50 51
6 50 61
7 60 71
8 70 81
9 80 91
10 90 31

your help is really appreciated

3 REPLIES
Enthusiast

Re: ranking and filtering

SEL RANK() OVER (ORDER BY VALUE1,VALUE2 ) FROM TABLE ;

Enthusiast

Re: ranking and filtering

Ofcourse add VALUE1,VALUE2 to select clause ..:)

Re: ranking and filtering

thanks for your help