当前位置:网站首页>MySQL 日期【加号/+】条件筛选问题
MySQL 日期【加号/+】条件筛选问题
2022-07-25 20:08:00 【小道仙97】
今天在修改一个SQL的时候发现一个关于时间格式的问题,原SQL如下(已简化)
SELECT COUNT(*)
FROM im_first_statistics
WHERE prj_code IN('yxjt3311')
AND created_at BETWEEN '2022-07-20+00:00:00' AND '2022-07-20+23:59:59'
SQL运行也没有问题,但执行结果却和预期不一样。
写了一个日期对比的SQL,执行结果如下

想着会不会是MySQL按照字符串去对比,当对比到 + 大于 的时候就不再进行后续了。当然这是一种不规范的写法,还是不要这样写为妙。
边栏推荐
- 【高等数学】【6】多元函数微分学
- Timing analysis and constraints based on xlinx (1) -- what is timing analysis? What are temporal constraints? What is temporal convergence?
- CarSim仿真快速入门(十五)—CarSim传感器仿真之ADAS Sensor Objects (1)
- QML combines qsqltablemodel to dynamically load data MVC "recommended collection"
- Apache MINA框架「建议收藏」
- PMP practice once a day | don't get lost in the exam -7.25
- 各厂商网络虚拟化的优势
- 谷歌Pixel 6a屏下指纹扫描仪存在重大安全漏洞
- 【高等数学】【8】微分方程
- PreScan快速入门到精通第十八讲之PreScan轨迹编辑的特殊功能
猜你喜欢

sentinel简单限流和降级demo问题记录

Share 25 useful JS single line codes

During the interview, I was asked how to remove the weight of MySQL, and who else wouldn't?

"Share" devaxpress asp Net v22.1 latest version system environment configuration requirements

Rainbond插件扩展:基于Mysql-Exporter监控Mysql

【高等数学】【5】定积分及应用

Prescan quick start to master Lesson 19: prescan actuator configuration, track synchronization and non configuration of multiple tracks
![[wp]ctfshow-web getting started - Explosion](/img/4b/6d8f4c044578382b9353d4d1c69c8f.png)
[wp]ctfshow-web getting started - Explosion

【高等数学】【4】不定积分

PMP每日一练 | 考试不迷路-7.25
随机推荐
Error when creating dataset with mindscore
How much memory does bitmap occupy in the development of IM instant messaging?
9.< tag-动态规划和子序列, 子数组>lt.718. 最长重复子数组 + lt.1143. 最长公共子序列
谷歌Pixel 6a屏下指纹扫描仪存在重大安全漏洞
A high efficiency 0-delay 0-copy QT player scheme based on Hisilicon 3559
Do you still have certificates to participate in the open source community?
「分享」DevExpress ASP.NET v22.1最新版本系统环境配置要求
When AI encounters life and health, Huawei cloud builds three bridges for them
QQ是32位还是64位软件(在哪看电脑是32位还是64位)
[today in history] June 30: von Neumann published the first draft; The semiconductor war in the late 1990s; CBS acquires CNET
CarSim仿真快速入门(十四)—CarSim-Simulink联合仿真
[cloud native | learn kubernetes from scratch] VIII. Namespace resource quotas and labels
[today in history] June 28: musk was born; Microsoft launched office 365; The inventor of Chua's circuit was born
Mindspore1.1.1 source code compilation and installation -- errors in the core compilation stage
Authorized wireless communication standard
RF、GBDT、XGboost特征选择方法「建议收藏」
Rainbond插件扩展:基于Mysql-Exporter监控Mysql
Apache MINA框架「建议收藏」
tiktok如何破零播放?
PMP practice once a day | don't get lost in the exam -7.25