很多时候需要卡一个区间 就要判断包含边界情况 先说答案 包含
版本
mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 5.7.26 |
+-----------+
1 row in set (1.06 sec)
对象 :业务主键
mysql> select id from alarm_detector;
+----+
| id |
+----+
| 1 |
| 2 |
| 3 |
| 4 |
+----+
4 rows in set (0.06 sec)
查询 between
mysql> SELECT id from alarm_detector WHERE id BETWEEN 1 and 4;
+----+
| id |
+----+
| 1 |
| 2 |
| 3 |
| 4 |
+----+
4 rows in set (0.03 sec)
原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/274531.html