I\'ve the below result
VendorName | IncidentID | IncidentStatus | IncidentDate ------------------------------------------------------- XYZ | 100 |
select vendorname, incidentid, incidentstatus, incidentdate, max(incidentdate) over (partition by vendorname order by incidentdate desc) max_incidentdate from t1 order by max_incidentdate desc, incidentdate desc