I'm currently working on a function in MYSQL, I have a comma delimited string (1,22,344,55) from another table, How can I split this in MYSQL to an array (NOT temp_table). Also, is there a similar function in MYSQL where I can do foreach()?
相关问题
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- Why sometimes there is one of more gap(s) in the v
- mySQL alter table on update, current timestamp
SQL's version of foreach is called a cursor
MySQL does not include a function to split a delimited string. However, it’s very easy to create your own function.
Usage
From here: http://blog.fedecarg.com/2009/02/22/mysql-split-string-function/
The correct usage in MySQL is:
Gives as result: 2