一个 SQL 语句的问题

图片描述

这是我数据库中的时间, 是时间戳,

我想通过 搜索 或者 SQL 语句

搜索出当月 或 某月 1-31 号 update_time 字段

阅读 2.4k
2 个回答
select * from tbl where update_time between unix_timestamp('2019-01-31 00:00:00') and unix_timestamp('2019-01-31 23:59:59') 

时间范围也可以计算好传给sql

select * from tbl where update_time between a时间戳 and b时间戳 尽量不要在条件中做运算

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题