In post-post it seems to be possible to split a line by delimiters and get an array suitable for the IN operator.
And how can you do this in mysql? Those. you need it to work:
where id IN ("1,2,3,4") In post-post it seems to be possible to split a line by delimiters and get an array suitable for the IN operator.
And how can you do this in mysql? Those. you need it to work:
where id IN ("1,2,3,4") There should be no problem with this in mysql. Only you, in your example, for nothing took all the id in some quotes, it will not work like that, they are perceived as one line.
SELECT * FROM tbl_name WHERE id IN ("2","19","20"); and for numbers you can even without quotes
SELECT * FROM tbl_name WHERE id IN (2,19,20); You can use the MySQL function FIND_IN_SET :
where FIND_IN_SET(id, "1,2,3,4") Source: https://ru.stackoverflow.com/questions/413290/
All Articles