0
I have the following situation:
Usuario_A telefone1
Usuario_A telefone2
Usuario_A telefone3
How can I make so that when I make a select, I have the following output:
+-----------+----------------------------------+
| Usuario_A | telefone1, telefone2, telefone3 |
+-----------+----------------------------------+
In Mysql I know I have the function GROUP_CONCAT
, more to SQL Server did not identify something that can help me to solve.
It would be interesting to put a more concrete example with the table structure, example data in the table and the expected output values. The
group_concat
joins the row data in column and in the title of your question is the opposite of this. If you want to use the Sqlfiddle to put the example that would work in Mysql– Pagotti
If the SQL Server version is 2017 (or newer), you can use STRING_AGG
– José Diz
This answers your question? How to concatenate lines?
– Sorack