can you give me an example request showing how I can combine two duplicate lines merge one?
id | name | no |
---|---|---|
123 | aaa | 1,2,3 |
124 | aaa | 4,5,6 |
125 | aaa | 7,8,9 |
i want this
id | name | no |
---|---|---|
123 | aaa | 1,2,3,4,5,6,7,8,9 |
I researched whether I could update with concat, but I couldn’t get any results.
2
Answers
You can use
ORDER BY
inside theGROUP_CONCAT
:Demo here
First do the update:
And then do the delete:
Here’s a db<>fiddle.