Here are 2 (untested) ways, see if they work and which one is faster for you:select orgid ,lastModified ,LastModifiedByfrom tblBudget_Data bdwhere lastModified = (select max(lastModified) from tblBudget_Data where orgid = bd.orgid)select b.orgid ,b.lastModified ,b.LastModifiedByfrom ( select OrgID ,max(LastModified) LastModified from tblBudget_Data group by orgID ) ajoin tblBudget_Data b on b.orgid = a.orgid and b.LastModified = a.LastModified
Be One with the OptimizerTG