Click here to Skip to main content
15,899,825 members

Comments by srikanthakasapu (Top 2 by date)

srikanthakasapu 3-Feb-14 4:23am View    
Hi Tomas,

Thanks for the reply. I apologize that i have told some of the iffs and buts...

I dont not want to use any of the rank functions or the top operators and all. I just only recursive CTE.

There might be multiple ways to write the query but i need only recursive CTE.

Thanks
Srikanth A.
srikanthakasapu 31-Jan-14 7:22am View    
Hi,

Its simple, i have a table like this

NAME SALARY
ABC 12200
BBB 25463
CCV 5555
EEE 8568
JJK 42668
LLL 6599
MKK 56985
QWE 25698
RRR 5445
RTR 12586
RTY 16565
SSS 96887
YUY 545

Now, i need to find for example 5th highest salary or 6th highest salary or 3rd what ever it is from the table.

This, i have to do in a recursive CTE.

Please do reply if it is still not clear.

Thanks
Srikanth