Select the last record or second highest salary

by 4:50 AM 0 comments

with latest as (SELECT ROW_NUMBER() OVER(PARTITION BY employeeId ORDER BY salary
DESC) As num , empName,Salary fromE EmpMaster)SELECT empName,Salary
FROM latest
WHERE num=1

ravi tuwar


Cras justo odio, dapibus ac facilisis in, egestas eget quam. Curabitur blandit tempus porttitor. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.


Post a Comment