当前位置:网站首页>SQL query time period content
SQL query time period content
2022-06-26 05:39:00 【Gerald picker Shea】
Ideas
- A certain time period is sent from the front end
startTime(String )
-endTime(String )
The format is days, excluding hours, minutes and seconds - Writing sql Is to add the time format to the corresponding field
DATE_FORMAT(crh.create_time,'%Y-%m-%d')
Specific date ( Free to define ) - Query results : for example 2022-6-8 To 2022-6-10 Time period
- The results include 6-8 0 Point to 6-10 Number 59 branch 59 second
sql
select * from u_user where 1=1
<if test="user.endTime != null and user.endTime != '' and user.startTime != null and user.startTime != ''">
and DATE_FORMAT(crh.create_time,'%Y-%m-%d') >=#{
user.startTime}
and
DATE_FORMAT(crh.create_time,'%Y-%m-%d') <=#{
user.endTime}
</if>
边栏推荐
猜你喜欢
LeetCode_二叉搜索树_简单_108.将有序数组转换为二叉搜索树
12 multithreading
Serious hazard warning! Log4j execution vulnerability is exposed!
Sofa weekly | open source person - Yu Yu, QA this week, contributor this week
小小面试题之GET和POST的区别
DOM文档
Could not get unknown property ‘*‘ for SigningConfig container of type org. gradle. api. internal
Redis discovery bloom filter
Supplementary course on basic knowledge of IM development (II): how to design a server-side storage architecture for a large number of image files?
使用Jenkins执行TestNg+Selenium+Jsoup自动化测试和生成ExtentReport测试报告
随机推荐
新的征程
自定义WebSerivce作为代理解决SilverLight跨域调用WebService问题
旧情书
Life is so fragile
The news of thunderbolt
LeetCode_二叉搜索树_简单_108.将有序数组转换为二叉搜索树
生命原来如此脆弱
RIA ideas
Baidu API map is not displayed in the middle, but in the upper left corner. What's the matter? Resolved!
Redis usage and memory optimization
How to make your big file upload stable and fast?
A love that never leaves
Source code of findcontrol
Project suspension
Secondary bootloader about boot28 Precautions for ASM application, 28035
SOFA Weekly | 开源人—于雨、本周 QA、本周 Contributor
Introduction to alluxio
pytorch(环境、tensorboard、transforms、torchvision、dataloader)
C XX management system
Mysql 源码阅读(二)登录连接调试