mysql日期查询边界问题
这样查询是可以查单20号数据的
这样是查不到数据的
使用between and看一下
这样也查不到数据
这样查就查到了数据
原因分析:
原因是因为scan_time扫描时间的datatime类型
select sch.scan_type, sch.scan_time from sys_scan_history sch where sch.scan_time between'2022这样查询是可以查单20号数据的
这样是查不到数据的
使用between and看一下
这样也查不到数据
这样查就查到了数据
原因分析:
原因是因为scan_time扫描时间的datatime类型
select sch.scan_type, sch.scan_time from sys_scan_history sch where sch.scan_time between'2022