MYSQL select the monday of two weeks ago
How do I select not last Monday, but the Monday before, for use in a where statement like so:
WHERE DATE(ramses.batch_log.start_time) < DATE_SUB(now开发者_StackOverflow社区(), INTERVAL 2 WEEK)
So, two weeks ago, but not from Today(Wednesday), from Monday.
EDIT cleaner and correct one:
WHERE DATE(ramses.batch_log.start_time) < SUBDATE(SUBDATE(NOW(), INTERVAL WEEKDAY(NOW()) DAY), INTERVAL 2 WEEK);
精彩评论