首页 > 如何返回特定时间戳之前第一个帖子所在的日期的全天帖子?

如何返回特定时间戳之前第一个帖子所在的日期的全天帖子?

如题

数据库中日期使用 PHP(10位) 时间戳储存
想根据时间戳 请求 这时间戳之前第一个帖子所在日期的一整天帖子数据
请问如何获取?

表名 posts
时间戳 created int(10)


SELECT @d := created FROM posts WHERE created < 1234567890  ORDER BY created DESC LIMIT 0, 1;
SELECT * FROM posts WHERE created < @d AND created >= (@d - @d % (24*60*60));
【热门文章】
【热门文章】