2

In mysql query am using grpup_concat function to concatenate the rows. It resulting the correct values but it is adding separator. for ex: my result for specified column as below.

{10,20}|,{20,30}|,{40,50} // pipe symbol i have added as a separator but it is again adding comma as a separator.

desired result: {10,20}|{20,30}|{40,50}

let me know how to remove the separator. Thanks in advance.

1
  • Can you try a : GROUP_CONCAT(split(field, ","), '|') Commented Oct 5, 2017 at 6:13

1 Answer 1

8

Whatever you need as s separator, specify after SEPARATOR keyword just like below:

SELECT GROUP_CONCAT(field_name SEPARATOR '|') FROM table_name

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.