时间:2021-07-01 10:21:17 帮助过:12人阅读
讲解:
SELECT * FROM tbl_student_info WHERE `height` between 1113 and 1122
等同于:
SELECT * FROM tbl_student_info WHERE `height` >= 1113 and `height` <= 1122
SELECT * FROM tbl_student_info WHERE `createDate` between ‘20170101020304‘ and ‘20180101020304‘ 等同于: SELECT * FROM tbl_student_info WHERE `createDate` >= ‘20170101020304‘ and `createDate` <= ‘20180101020304‘
另外一种时间范围查询的方法如下:分别设定开始时间和结束时间:
<if test="endTime!=null and !"".equals(endTime.trim())"> AND m.endTime < #{endTime} </if> <if test="startTime!=null and !"".equals(startTime.trim())"> AND m.startTime > #{startTime} </if>
mysql中between...and..的使用,及时间范围的查询
标签:student 范围 inf equals amp post current test pre