Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Fix Version/s: N/A
    • Component/s: None
    • Labels:
      None

      Description

      nice to have a function split:

      SELECT split("1,2,3,4,5", ',');

      returns:
      1
      2
      3
      4
      5

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            jwang james wang added a comment -

            Does this incur a lot development time please?

            Basically, I wish to convert a comma separated string, e.g. @str1="1,2,3,4,5", to an array @arr1 so I can use it in, e.g.

            SELECT uid FROM table1 WHERE id IN (@arr1);

            Thanks a lot in advance
            James

            Show
            jwang james wang added a comment - Does this incur a lot development time please? Basically, I wish to convert a comma separated string, e.g. @str1="1,2,3,4,5", to an array @arr1 so I can use it in, e.g. SELECT uid FROM table1 WHERE id IN (@arr1); Thanks a lot in advance James
            Hide
            serg Sergei Golubchik added a comment -

            Yes, it does.

            But you can use FIND_IN_SET() function instead:

            SELECT uid FROM table1 WHERE find_in_set(id, @arr1);
            
            Show
            serg Sergei Golubchik added a comment - Yes, it does. But you can use FIND_IN_SET() function instead: SELECT uid FROM table1 WHERE find_in_set(id, @arr1);
            Hide
            jwang james wang added a comment -

            If it takes too much development time. please ignore this request.

            Used find_in_set before, it was slow.

            Of course, I can store @arr1 in my program and pass it to the second query as a parameter - very quick this way - but need to change code.

            I was just wonder if there was a simpler way.

            Show
            jwang james wang added a comment - If it takes too much development time. please ignore this request. Used find_in_set before, it was slow. Of course, I can store @arr1 in my program and pass it to the second query as a parameter - very quick this way - but need to change code. I was just wonder if there was a simpler way.
            Hide
            jwang james wang added a comment -

            please close this ticket as I could not (even as the reporter).

            Show
            jwang james wang added a comment - please close this ticket as I could not (even as the reporter).

              People

              • Assignee:
                Unassigned
                Reporter:
                jwang james wang
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: