当前位置:网站首页>[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
边栏推荐
- MySql的安装配置超详细教程与简单的建库建表方法
- uniapp uses 3rd party fonts
- My first understanding of MySql, and the basic syntax of DDL and DML and DQL in sql statements
- coldfusion8后台计划任务拿shell
- Xiaohei's leetcode journey: 104. The maximum depth of a binary tree
- PDF 拆分/合并
- Can an inexperienced college graduate switch to software testing?my real case
- 加密生活,Web3 项目合伙人的一天
- Basic Parameters of RF Devices 1
- 蛮力法/邻接矩阵 广度优先 有向带权图 无向带权图
猜你喜欢
随机推荐
一个无经验的大学毕业生,可以转行做软件测试吗?我的真实案例
Parameter introduction and selection points of wireless module
PDF 拆分/合并
keep-alive缓存组件
用户交互+格式化输出
TiKV主要内存结构和OOM排查总结
设置浏览器滚动条样式
uniapp uses 3rd party fonts
leetcode-952:按公因数计算最大组件大小
Programmer's debriefing report/summary
Distributed. Idempotency
VSCode插件:嵌套注释
leetcode-952: Calculate max component size by common factor
观察者(observer)模式(一)
Centos 7.9 install PostgreSQL14.4 steps
TiDB 操作实践 -- 备份与恢复
力扣每日一题-第46天-704. 二分查找
Shell 脚本循环遍历日志文件中的值进行求和并计算平均值,最大值和最小值
JPEG Steganalysis of Digital Image Steganography
Teach you how to configure Jenkins automated email notifications









