当前位置:网站首页>Find out the data that can match the keyword key in field 1 or field 2 in the database table. If you want to display the matching data in field 1 first
Find out the data that can match the keyword key in field 1 or field 2 in the database table. If you want to display the matching data in field 1 first
2022-06-12 23:13:00 【CSDN Q & A】
A project that wants to optimize mysql Fuzzy query function :
Business scenario : Find out the fields in the database table 1 Or field 2 Can match keywords in key The data of , Priority fields 1 Match in , But fields 2 Records that can be matched in the should also be displayed ;
present situation : I am using mysql concat(str1, str2) Function of , In this way, all matching results can be found , But you can't match fields by priority 1 First show .
Take the answer :
SQL First, check field 1 and then union all Can't field two , Otherwise elasticsearch Search scoring
边栏推荐
- 深度学习-神经网络:卷积的实现方法【直接法(精度没损失)、GEMM(矩阵乘法,精度没损失)、FFT(傅里叶变换,精度有损失)、Winograd(精度有损失)】
- [web technology] 1348- talk about several ways to implement watermarking
- vim利用右下4键
- Analysis report on the "fourteenth five year plan" and the latest development trend of China's medical information industry from 2022 to 2028
- Modify the text color of the menu on the right of toobar
- Insight into China's smart medical industry in 2022
- Matters of parent-child class construction method in inheritance
- About three-tier architecture and MVC
- Photoshop:ps how to enlarge a picture without blurring
- Opencv source code compilation
猜你喜欢
基于51单片机的酒精检测仪
Unprecedented analysis of Milvus source code architecture
The shutter library recommends sizer to help you easily create a responsive UI
Flutter库推荐Sizer 可帮助您轻松创建响应式 UI
Photoshop:PS如何实现放大图片不模糊
Leetcode1601: the maximum number of building change requests that can be reached (difficult)
2022 heavyweight: growth law - skillfully use digital marketing to break through enterprise difficulties
设计消息队列存储消息数据的 MySQL 表格
模型过拟合-解决方案(二):Dropout
应用最广泛的动态路由协议:OSPF
随机推荐
Heilongjiang Branch and Liaoning Branch of PostgreSQL Chinese community have been established!
Gradient accumulation in pytorch [during the experiment, due to the limitation of GPU video memory, the batch\u size can no longer be increased. To solve this problem, the gradient accumulation method
[leetcode] the k-largest element in the array
About three-tier architecture and MVC
自动获取结构体内部成员变量的位置偏移
The carrying capacity of L2 level ADAS increased by more than 60% year-on-year in January, and domestic suppliers "emerged"
同花顺股票账户开户安全吗
MYSQL 行转列、列转行、多列转一行、一行转多列
[890. find and replace mode]
China's elastic belt market trend report, technical dynamic innovation and market forecast
Lua date time
Summary of MySQL foundation view
CST learning: four element array design of circular patch antenna (II) array formation and combination results
Design of traceid in the project
Colab tutorial (super detailed version) and colab pro/colab pro+ usage evaluation
设计消息队列存储消息数据的 MySQL 表格
Report on the "fourteenth five year plan" and strategic strategy recommendations for China's intellectual property protection industry 2022 ~ 2028
web3 原则和去中心化
模型过拟合-解决方案(二):Dropout
Record 5 - the serial port of stm32f411ceu6 realizes the sending and receiving of fixed length data and variable length data