我在 mqsql 数据库中有这个表
create table datedemo(logintime timestamp,updatedtime timestamp);
updatedtime 给出了用户最后一次活动的时间,我想执行一个查询
这样如果 updatedtime 和 now() 时间之间的差异大于某个值,例如(1000 秒)
下面的查询给出了时间戳的差异,但我想删除行,请帮忙
SELECT NOW(), updatedtime, NOW() - updatedtime AS diff
FROM datedemo
HAVING diff IS NOT NULL;