Taking the record with the max date
The analytic function approach would look something like SELECT a, some_date_column FROM (SELECT a, some_date_column, rank() over (partition by a order by some_date_column desc) rnk FROM tablename) WHERE rnk = 1 Note that depending on how you want to handle ties (or whether ties are possible in your data model), you may want to use … Read more