H
H
hesy2020-07-12 15:17:20
MySQL
hesy, 2020-07-12 15:17:20

How to select all rows containing numbers from a list?

How to select all records where numbersthere are values ​​at the same time, for example, 19 and 26?

The data is stored as "..., 19, 26, ...", may be in a different order.

This query displays all records where these numbers are (both together and separately, but only together)

SELECT * FROM `column` WHERE numbers REGEXP '19|26'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
N, 2020-07-12
@Fernus

SELECT * FROM `table` WHERE FIND_IN_SET('19', `numbers`) AND FIND_IN_SET('26', `numbers`);

Corrected the answer...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question