Self join [message #374981] |
Tue, 17 July 2001 04:32 |
Jaya Kumar NM
Messages: 11 Registered: August 2000
|
Junior Member |
|
|
I have a data like this
empno sal date
100 2000 10-jul-01
100 3000 12-jul-01
200 1000 10-jul-01
200 1000 14-jul-01
300 2000 10-jul-01
300 3000 12-jul-01
300 3000 14-jul-01
The output I want is
empno sal date
100 3000 12-jul-01
I want to compare only the last two rows for each employee(i.e max and second max date), if the salary is not matching the max(date) row should be displayed.
Thanks
|
|
|
|