Use fuzzy matching: select * from test where column like "%10%" PS: I feel that such a requirement is a bit strange, maybe the database design is unreasonable.
From the perspective of the question, the solution can be Custom function, used to segment fields, and then judge, 1. Custom function, to be added 2. Query statement select * from table where 1=hasTen(column)
A rough compromise select * from table where column like '10,%' || select * from table where column like '%,10,%' || select * from table where column like '%,10'
It may be easier to solve if you can ensure that the fields must be in the form of a and b
I don’t quite understand your question. According to my understanding, it is not simply select * from test where id = 10.
Use fuzzy matching:
select * from test where column like "%10%"
PS: I feel that such a requirement is a bit strange, maybe the database design is unreasonable.
From the perspective of the question, the solution can be
Custom function, used to segment fields, and then judge,
1. Custom function, to be added
2. Query statement
select * from table where 1=hasTen(column)
A rough compromise
select * from table where column like '10,%'
||
select * from table where column like '%,10,%'
||
select * from table where column like '%,10'
It may be easier to solve if you can ensure that the fields must be in the form of a and b
For reference:
select * from test where concat(',', column, ',') like "%,10,%"