mysql 时差
我正在尝试用 mysql 做一些垃圾邮件过滤器。我想检查用户在表中创建的最后一条记录并将其与当前时间进行比较。创建的时间以 mysql datetime
格式存储为 date_created
。
我已经尝试过TIMEDIFF()
,但我无法让它为我工作,请帮助。
I am trying to do a little spam filter with mysql. I want to check the last record a user has created in a table and compare it to the current time. The time created is stored as date_created
with mysql datetime
format.
I have tryed TIMEDIFF()
, but I can't get it to work for me, please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果此查询返回非零值,则存在该用户在上一小时创建的行
If this query returns non-zero value, then there are rows, created on last hour by this user
获取用户
x
的最新记录和与当前时间的时间差异To get the most recent record and time diff to current time for user
x