Simply Asking, Is there any function available in mysql to split single row elements in to multiple columns ? I have a table row with the fields, user_id, user_name, u
user_id, user_name, u
this should do it
DELIMITER $$ DROP PROCEDURE IF EXISTS `CSV2LST`$$ CREATE DEFINER=`root`@`%` PROCEDURE `CSV2LST`(IN csv_ TEXT) BEGIN SET @s=CONCAT('select \"',REPLACE(csv_,',','\" union select \"'),'\";'); PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt; END$$ DELIMITER ;