W
W
w_b_x2015-12-11 13:20:32
MySQL
w_b_x, 2015-12-11 13:20:32

MYSQL - How to get quotient in general enum?

Good afternoon!
There is a table:
| ID | CODE |
----------------
| 1 | 2.6 |
----------------
| 2 | 3, 6 |
----------------
| 3 | 3 |
I want to compose a SQL query in such a way as to display all the rows in which one way or another there are 3ka. Ie ID 2 and 3.
The number of CODES elements (3,5,6,1,...) can be arbitrarily large and the number of lines too.
Is it possible?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nozzy, 2015-12-11
@w_b_x

select * from table
where id = 3
and codes like '%3%'

R
romy4, 2015-12-11
@romy4

Maybe

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question