Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2015
    Posts
    1

    Unanswered: MYSQL - Convert comma separated string to rows

    Hi,

    Need some help.. In MYSQL, How to split a comma separated string into rows using regular expressions and without creating functions or procedures. The comma separated string length is dynamic. For eg.

    String: 23456,16524,84755,98457,06978,05986,73454,34785

    Result
    ------
    23456
    16524
    84755
    98457
    06978
    05986
    73454
    34785

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    What have you tried so far?

    Why can't you have a function or procedure to perform this action?
    George
    Home | Blog

  3. #3
    Join Date
    Oct 2015
    Posts
    1
    If I understand your question properly, the following function helps:

    SELECT REPLACE(your_string, ',', '\n');

    If you need each substring in a separate record, custom procedure is necessary.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •