1
I have a situation that would make it much easier. if I could return the data from a specific column in a single row:
For example:
Table A:
Codigo | Descricao
-------------------
1 | Descricao 1
2 | Descricao 2
3 | Descricao 3
I would like to mount an sql that returns me in a single line like this:
1,2,3
Only the code column..
Someone has some idea of how it is possible to do this.. and whether it is possible?
Just to be documented, in case someone in Future looks for the same thing, I used a similar function..
Select string_agg(cast(codigo as text),',') from tabelaA
to return as a text, not an array (How array returns { } together). But your answer was of fundamental importance. Thank you very much– Marco Giovanni