I am facing some issues with rank function when I am trying to use rank function on a select result set which is also using rank function.
Example sql query: