>select EDPNo, CaptureDate, ALertFlg >from (select EDPNo, CaptureDate, ALertFlg, row_Number() over (partition by edpno Order by CaptureDate DESC) as RowNumber >from ItemAlertFlgAudit ) D >where RowNumber = 1 >You're welcome. Watch out for the same dates within the group, this query will return one random record.