今天在mysql 执行
select * from hh_task_info t where t.code = '2000'
and t.fs is null
and t.create_date between '2020-07-01 00:00:00' and '2020-08-20 24:00:00'
查询结果为空
但是执行
select * from hh_task_info t where t.code = '2000'
and t.fs is null
and t.create_date >='2020-07-01 00:00:00' and t.create_date <='2020-08-20 24:00:00'
可以查出来
因为日期小时是0-23 不包含24 所以between and 无法查出来
而>= <= 是比较字符的大小
把24 改成25 依然可以查出来
select * from hh_task_info t where t.code = '2000'
and t.fs is null
and t.create_date >='2020-07-01 00:00:00' and t.create_date <='2020-08-20 25:00:00'
在oracle中
执行
select * from user_tables where last_analyzed between to_date( '2020/8/10 22:00:04','yyyy-mm-dd HH24:MI:SS') and to_date('2019/2/27 24:00:00','yyyy-mm-dd HH24:MI:SS')
直接报错