当前位置:网站首页>[1153]mysql中between的边界范围
[1153]mysql中between的边界范围
2022-07-31 01:47:00 【周小董】
mysql between的边界范围
between 的范围是包含两边的边界值
eg: id between 3 and 7 等价与 id >=3 and id<=7
not between 的范围是不包含边界值
eg:id not between 3 and 7 等价与 id < 3 or id>7
SELECT * FROM `test` where id BETWEEN 3 and 7;
等价于 SELECT * FROM `test` where id>=3 and id<=7;
-----------------------------------------------------------
SELECT * FROM `test` where id NOT BETWEEN 3 and 7;
等价于 SELECT * FROM `test` where id<3 or id>7;
mysql between日期边界的问题留意
边界问题:
mysql, between 开始日期 AND 结束日期 包含开始日期,不包含结束日期
例如:
BETWEEN '2018-01-22' AND '2018-01-30'
开始日期从2018-01-22 00:00:00.0 开始, 到2018-01-29 23:59:59.59结束
参考:https://www.jb51.net/article/214469.htm
边栏推荐
- 成为比开发硬气的测试人,我都经历了什么?
- 16、注册中心-consul
- MySQL的分页你还在使劲的limit?
- pycharm cannot run after renaming (error: can't open file...No such file or directory)
- Likou Daily Question - Day 46 - 704. Binary Search
- Interprocess communication study notes
- 【genius_platform软件平台开发】第七十四讲:window环境下的静态库和动态库的一些使用方法(VC环境)
- Word/Excel 固定表格大小,填写内容时,表格不随单元格内容变化
- Shell 脚本循环遍历日志文件中的值进行求和并计算平均值,最大值和最小值
- 软件测试工作3年了,谈谈我是如何从刚入门进阶到自动化测试的?
猜你喜欢
GCC Rust is approved to be included in the mainline code base, or will meet you in GCC 13
System design. Short chain system design
软件测试报告有哪些内容?
【Mysql】——索引的深度理解
leetcode-399:除法求值
JS逆向之浏览器补环境(一)
"Real" emotions dictionary based on the text sentiment analysis and LDA theme analysis
数字图像隐写术之JPEG 隐写分析
Meta元宇宙部门第二季度亏损28亿 仍要继续押注?元宇宙发展尚未看到出路
用户交互+格式化输出
随机推荐
《MySQL数据库进阶实战》读后感(SQL 小虚竹)
MySQL (6)
What is the ideal college life?
Crawler text data cleaning
软件测试基础接口测试-入门Jmeter,你要注意这些事
Word 表格跨页,仍然显示标题
Distributed. Distributed lock
Arbitrum Interview | L2 Summer, what does the standout Arbitrum bring to developers?
.NET 跨平台应用开发动手教程 |用 Uno Platform 构建一个 Kanban-style Todo App
软件测试要达到一个什么水平才能找到一份9K的工作?
My first understanding of MySql, and the basic syntax of DDL and DML and DQL in sql statements
Charging effect simulation
数字图像隐写术之JPEG 隐写分析
Xiaohei's leetcode journey: 104. The maximum depth of a binary tree
pycharm cannot run after renaming (error: can't open file...No such file or directory)
12张图带你彻底搞懂服务限流、熔断、降级、雪崩
Nacos
TiDB 操作实践 -- 备份与恢复
Path and the largest
MySql的初识感悟,以及sql语句中的DDL和DML和DQL的基本语法