首页 > 文章列表 > 如何使用 SQL 查询指定日期范围内的评论数据?

如何使用 SQL 查询指定日期范围内的评论数据?

190 2024-12-24

如何使用 SQL 查询指定日期范围内的评论数据?

查询指定日期范围

根据 create_time 时间戳查询 comment 表中今日指定 id 的数据。

查询语句:

select * from comment where to_days(create_time) = to_days(now()) and id = 21;
来源:1730361711