开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜