当前位置:网站首页>[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
边栏推荐
猜你喜欢
934. 最短的桥
221. 最大正方形
【genius_platform软件平台开发】第七十四讲:window环境下的静态库和动态库的一些使用方法(VC环境)
Kyushu cloud as cloud computing standardization excellent member unit
coldfusion文件读取漏洞(CVE-2010-2861)
The difference between 4G communication module CAT1 and CAT4
观察者(observer)模式(一)
MySQL stored procedure
uniapp使用第三方字体
最高月薪20K?平均薪资近万...在华为子公司工作是什么体验?
随机推荐
The PC side determines the type of browser currently in use
android的webview缓存相关知识收集
MySQL的分页你还在使劲的limit?
rpm安装postgresql12
【flask入门系列】Flask-SQLAlchemy的使用
VSCode插件:嵌套注释
1782. Count the number of point pairs Double pointer
Bert usage and word prediction based on Keras_bert model
TiCDC 架构和数据同步链路解析
TiDB 操作实践 -- 备份与恢复
内网渗透——提权
仿牛客网项目总结
Basic Parameters of RF Devices 1
Parameter introduction and selection points of wireless module
倍增、DFS序
GCC Rust获批将被纳入主线代码库,或将于GCC 13中与大家见面
MySQL installation tutorial (detailed, package teaching package~)
C语言_结构体指针数组函数选票系统
九州云获评云计算标准化优秀成员单位
斩获BAT、TMD技术专家Offer,我都经历了什么?