• Select * From #temp t1 Where

    (2-1) = (Select Count(Distinct(t2.empWage)) From #temp t2 Where

    t2.empWage > t1.empWage)

    The innery query will return a refernce to the current row.

    Genreal Format will be,

    Select * From #temp t1 Where

    (N-1) = (Select Count(Distinct(t2.empWage)) From #temp t2 Where

    t2.empWage > t1.empWage)

    The N should be replaced the by the number(Rank) which u hav to find.