Suppose I have the following table:
ID|Col1 |Col2
1 |Test1 |Test12
2 |Test2 |Test22
2 |Test3 |Test32
When I use a query like:
SELECT GROUP_CONCAT(Col1) as First, GROUP_CONCAT(Col2) as Second WHERE ID=2 GROUP BY ID
It sometimes returns the GROUP_CONCAT's rearranged. For example:
ID|First |Second
2 |Test2,Test3|Test32,Test22
While I would expect it to return:
ID|First |Second
2 |Test2,Test3|Test22,Test32
As you can see, it switched the concatenated values in the column named 'Second'. How can I prevent this from happening?