current position:Home>SQL statement fuzzy query and time interval filtering
SQL statement fuzzy query and time interval filtering
2022-01-27 04:35:34 【Rolling mill】
Recently, I made an interface parameter, which is the project of querying the database , Make up for it sql sentence
Fuzzy query ( The simplest way to write % arbitrarily %)
select * from log where seatname like'%192.168.15.121%'
One requirement is to query all the data in the database start time field in the time interval selected by the two time selectors and flashback the query according to the creation time of each data , Then consider performance ( Too much database data ) I also made paging query function , therefore sql The sentences are longer
sql=`SELECT * FROM log where username like '%${prams}%' and start_time >= '${setTime}' AND start_time <= '${endTime}' ORDER BY CreatedTime DESC LIMIT ${(page-1)*20},20`;
copyright notice
author[Rolling mill],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270435325031.html
The sidebar is recommended
- Spring IOC container loading process
- [thinking] the difference between singleton mode and static method - object-oriented programming
- Force deduction algorithm - 92 Reverse linked list II
- What is the sub problem of dynamic programming?
- C / C + +: static keyword summary
- Idea does not have the artifacts option when configuring Tomcat
- I don't know how to start this
- MySQL slow log optimization
- [Vue] as the window is stretched (larger, smaller, wider and higher), the text will not be displayed
- Two pronged approach, Tsinghua Professor Pro code JDK and hotspot source code notes, one-time learning to understand
guess what you like
-
C + + recursive knapsack problem
-
The use of GIT and GitHub and the latest git tutorial are easy to understand -- Video notes of crazy God speaking
-
Ignition database test
-
A list that contains only strings. What other search methods can be used except sequential search
-
[matlab path planning] multi ant colony algorithm grid map path planning [including GUI source code 650]
-
[matlab path planning] improved genetic algorithm grid map path planning [including source code phase 525]
-
Reactnative foundation - 07 (background image, status bar, statusbar)
-
Reactnative foundation - 04 (custom rpx)
-
Java project: OA management system (java + SSM + bootstrap + MySQL + JSP)
-
[data structure] chain structure of binary tree (pre order traversal) (middle order traversal) (post order traversal) (sequence traversal)