Skip to content
Advertisement

Split comma separated string into rows in mysql

When I have string list like 1, 2, 3… I’d like to use this as one column

Is it possible by sql query?

ex) SELECT Ids from (1, 2, 3...) <- I know this is not working.

Advertisement

Answer

Use a subquery of arbitrary digits to split your string.Instead of vals you can use ‘1,2,3’.

See it working

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement