Jayraj Goswami

Jayraj Goswami

  • NA
  • 198
  • 12.5k

How to Get All Max ID Record

Feb 22 2016 8:15 AM
;with Cte
AS (
SELECT ROW_NUMBER() OVER (
PARTITION BY LeaveID ORDER BY NID DESC
) AS SrNo
,*
FROM tblLeaveNotifications
WHERE EmpCode = 'EMP-0136'
)
SELECT *
FROM Cte
WHERE SrNo = 1