6
I created a table for example:
I have the following content:
select * from table_t;
And I need to get the following result:
In Mysql I use the following query:
select group_concat(concat_ws(' - ',id,descri)) id_descri, tipo from table_t group by tipo;
What about Sqlserver? Thank you!
Wouldn’t it be possible to do that on the app? For example, select the types, then loop the result and for each type select the descriptions and ids! I did this way with group_concat, but I’ve had problems of slowness with a very large table and maintenance was also more complicated.
– Marcelo Diniz
Yes, it would be possible, as I know the feature in Mysql and for the sake of performance I prefer it to be in db itself.
– marcelo_drummer
I understood, but as for the question of performance, when I did this and had a lot of lines, the performance was much higher in the application itself, but then you should know how much to your side ai.
– Marcelo Diniz