Mysql: Find rows, where timestamp difference is less than x

前端 未结 3 1817
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-24 07:35

I\'ve got table structure as follows:

Field       Type
id              int(11)      AI
user            varchar(64)
date            timestamp
key             int         


        
3条回答
  •  面向向阳花
    2021-01-24 07:54

    DATEDIFF(t.netxdata, t.date) < (1300 / 3600 / 24) I assumed 1300 in in seconds, so I converted it to days which is what DATEDIFF returns. Please, be aware that this query will do a full scan of your table, which might be expensive.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题