Home | Feedback | Login

Select MAX

This is a basic example how to select max.

select a.item, a.valuation, a.referencedate
from valuations a
  join(select a2.item, max(referencedate)as max_date
        from valuations a2
        groupby a2.item
  ) b ON a.item = b.item and a.referencedate = b.max_date