Hi I have a table with a date field and other information. I want to select all entries for the last week (beginning of the week from Sunday).
table values:
id date 2 2011-05-14 09:17:25 5 2011-05-16 09:17:25 6 2011-05-17 09:17:25 8 2011-05-20 09:17:25 15 2011-05-22 09:17:25
I want to select all identifiers from last week, the expected result is 5, 6, 8. (id 2 is not last week, but id 15 is this week.)
How to write and SQL query for the same.
sql database mysql datetime
coderex May 22 '11 at 18:42 2011-05-22 18:42
source share