Problem description: structure: test has two fields, For example, col1 content is: 26,59,6
Select an id, such as 59, and then enter a number, such as: 2000 Example: If there are the following three records, search for records with id 59 and value less than 2000: 26,59,6 | 1502.5,1690,2276.77 The three records with id 59 are searched, and then the second search condition is determined to be (that is, the numbers at the corresponding id positions are compared): 1690<2000 drop table test; create table test ( col1 varchar(100), col2 varchar(100)); insert test select '26,59,6', '1502.5,1690,2276.77' union all select '59,33,6', '3502.1,1020,2276.77' union all select '22,8,59', '1332.6,2900,1520.77'; select col1,col2 from (select *,find_in_set('59',col1) as rn from test) k where substring_index(concat(',',substring_index(col2,',',rn)),',',-1) <'2000'; +---------+---------------------+ | col1 | col2 | +---------+---------------------+ | 26,59,6 | 1502.5,1690,2276.77 | | 22,8,59 | 1332.6,2900,1520.77 | +---------+---------------------+ |
<<: js uses cookies to remember user page operations
>>: How to bind Docker container to external IP and port
Things to note 1. First, you need to create a my....
The first method: Use Junge's one-click scrip...
Attribute check-strictly The official document pr...
Preface I have read many similar articles before,...
This article mainly explains how to deploy Elasti...
Table of contents 1. Overview 1.1 Definition 1.2 ...
When I first used docker, I didn't use docker...
Preface For production VPS with public IP, only t...
Table of contents 1. MySQL time type 2. Check the...
REPLACE Syntax REPLACE(String,from_str,to_str) Th...
The following problem occurred when installing my...
This article shares the specific method of instal...
What if the basic images have been configured bef...
Table of contents Axios Request Qs processing dat...
This article shares the specific code of JavaScri...