We have table like below
person_id | salary
1 | 1500
1 | 1000
1 | 500
2 | 2000
2 | 1000
3 | 3000
3 | 2000
4 | 3000
4 | 1000
We want second highest salary for each person. grouping by each person and get second highest salary for person. like below
person_id | salary
1 | 1000
2 | 1000
3 | 2000
4 | 1000
Thanks in advance :)