Answer the question
In order to leave comments, you need to log in
How to make multiselect with sort from MySQL?
A task with a selection from muscle, there is a table in the database in which one of the columns has values \u200b\u200blike those on the screen , I need to make a selection by several numbers.
Options like:
SELECT * FROM `table` WHERE cat LIKE '%10%' or cat LIKE '%25%' or cat LIKE '%27%';
SELECT * FROM `table` WHERE FIND_IN_SET('10', cat) or FIND_IN_SET('25', cat) or FIND_IN_SET('27', cat);
Answer the question
In order to leave comments, you need to log in
It's a clear design error. This table does not follow first normal form , which requires that each tuple in the table contain only one value per attribute. That is, in 1 cell there should be only one value.
Perhaps what you are asking can be solved in some sophisticated way, but most likely further problems will appear related to this error. The best solution would be to normalize the tables in your database to 3rd or at least 2nd normal form. Such problems, after that, should not arise at all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question