I have a big MySQL SELECT query, that I need to convert into one string only, so I can make an UPDATE out of it, without having to use two separate querys. For the sake of simplicity, let's assume we have a SELECT query that returns this result:
How do I convert all of it into something like this :
That I can use to UPDATE some other table with ?
Knowing that both the number of columns and rows can change and are not static. (very important ! Especially the columns!). How can I pull this off ? I don't think
CONCAT() can help in this situation.
Any help would be appreciated. Thanky ou.
Can you try this?
SELECT group_concat(concat(id, ',', name, ',', age) separator ';') FROM test