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

Developer

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

0 comments:

Post a Comment