TOP and Distinct TogetherHello.
I have one table with salary details against empId.
Columns like, (Id, EmpId, SalaryPeriod, GrossSalary).
I have 100 employees and as per the 12 months, i have 12 records per employee.
Total records = 1200
I want to write a query by using I get all employee's nth salary (order by).
So, I can get 100 rows as a result with EmpId and top nth salary in second column.
Please help me to write this query.
Also, consider one more scenario which is optional...
Employees can have same salary for all the 12 months and If I want top 2nd salary, what will be the result.?