I have been trying to find some info on how to select a non-aggregate column that is not contained in the Group By statement in SQL, but nothing I\'ve found so far seems to
select * from
(
select MyPK, fmgcms_cpeclaimid, createdon,
Rank() over (Partition BY fmgcms_cpeclaimid order by createdon DESC) as Rank
from Filteredfmgcms_claimpaymentestimate
where createdon < 'reportstartdate'
) tmp
where Rank = 1