[Solved] SQL Values splitted by “,” [closed]


using a defined function found here: http://blog.fedecarg.com/2009/02/22/mysql-split-string-function/
if you know your data has maximum of 3 values like 1,2,3 you can try this sqlFiddle example

SELECT value
FROM
  (
   SELECT SPLIT_STR(value,',',1) AS value FROM t
   UNION ALL
   SELECT SPLIT_STR(value,',',2) AS value FROM t
   UNION ALL
   SELECT SPLIT_STR(value,',',3) AS value FROM t
  )T1
WHERE value <> '';

if you know your data has maximum of 5 values like 1,2,3,4,5 you can just add 2 more UNION ALL

1

solved SQL Values splitted by “,” [closed]