Tags

,


SELECT *
FROM
(SELECT StaffUserEventLogId ,
StaffUserEventTypeId ,
StaffUserId ,
Created ,
RemoteAddress,
SessionId,
ROW_NUMBER() OVER (partition by staffuserid ORDER BY Created DESC) AS RowNum
FROM StaffUserEventLog) AS A
WHERE RowNum = 1 and StaffUserId in (44, 49)

Spent 4hrs, so putting it here.

Advertisements