Monday, July 21, 2014

HAVING (UpdatedDate = MAX(UpdatedDate))

Getting 1 ID for each of the latest Updated records:

SELECT        ID, UpdatedDate
FROM            SomeTable
GROUP BY  ID, UpdatedDate
HAVING        (UpdatedDate = MAX(UpdatedDate))

0 Comments:

Post a Comment

<< Home