How do I limit the date?

I want to highlight all records from a table where date is the latest, and only those.

For example: today is May 16, the last records from my table date from May 15, but I have older ones (May 14, May 13, etc.). I would like to select only the date from May 15th, but this is not that specific date, I need to select each record dated from the latest date available in my database.

How?

thanks in advance

+2


a source to share


1 answer


SELECT [list]
FROM MyTable MT1
WHERE MT1.date = (
     SELECT MAX(MT2.date)
     FROM MyTable MT2
  )

      



+5


a source







All Articles