开发者

Select log lines from today in mysql

I never remember how to do this properly -开发者_开发百科 can you help me fix this query?

SELECT * from log where now() - EventTime < '1 day'

Note - this question seems identical but there's no solution there for mysql.


SELECT * FROM log WHERE EventTime >= DATE_SUB(CURDATE(), INTERVAL 1 DAY);


SELECT * FROM log WHERE SUBDATE(NOW(), 1) < EventTime

Or to only select the ones from today:

SELECT * FROM log WHERE DATE(NOW()) = DATE(EventTime)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜