当前位置:网站首页>[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
边栏推荐
猜你喜欢
pycharm重命名后无法运行(报错: can‘t open file......No such file or directory)
两个有序数组间相加和的Topk问题
九州云获评云计算标准化优秀成员单位
After reading "MySQL Database Advanced Practice" (SQL Xiao Xuzhu)
仿牛客网项目总结
最大路径和
coldfusion8后台计划任务拿shell
TiCDC 架构和数据同步链路解析
GCC Rust is approved to be included in the mainline code base, or will meet you in GCC 13
VSCode插件:嵌套注释
随机推荐
SQLserver查询最近三个月的数据,语句该怎么写sqlserver
一个无经验的大学毕业生,可以转行做软件测试吗?我的真实案例
Kyushu cloud as cloud computing standardization excellent member unit
Basic Parameters of RF Devices 1
pycharm重命名后无法运行(报错: can‘t open file......No such file or directory)
leetcode-952: Calculate max component size by common factor
CV-Model [3]: MobileNet v2
MySQL的分页你还在使劲的limit?
【Mysql】——索引的深度理解
Likou Daily Question - Day 46 - 704. Binary Search
数字图像隐写术之JPEG 隐写分析
leetcode-1161: Maximum in-layer element sum
Centos 7.9 install PostgreSQL14.4 steps
Jiuzhou Cloud was selected into the "Trusted Cloud's Latest Evaluation System and the List of Enterprises Passing the Evaluation in 2022"
汉诺塔问题
软件测试基础接口测试-入门Jmeter,你要注意这些事
什么是理想的大学生活?
力扣每日一题-第46天-704. 二分查找
Meta元宇宙部门第二季度亏损28亿 仍要继续押注?元宇宙发展尚未看到出路
黄东旭:TiDB的优势是什么?