tags:

views:

54

answers:

1

I'd like to select all entries from a table where date is the last one and only those ones.

For example: today is May 16th, the last entries I have from my table is dated from May 15th, but I have older ones (May 14th, May13th, etc). I'd like to select only the dated from May 15th, but it's not this specific date, I need to select every entry dated from the last date I have in my database.

How to?

Thx in advance

+5  A: 
SELECT [list]
FROM MyTable MT1
WHERE MT1.date = (
     SELECT MAX(MT2.date)
     FROM MyTable MT2
  )
PatrikAkerstrand