You can use the array () and array_to_string () functions associated with your request. Using a SELECT array( SELECT id FROM table ); You will get the result, for example: {1,2,3,4,5,6}
Then, if you want to remove the {} characters, you can simply use the array_to_string () function and use a comma as a separator, so: SELECT array_to_string( array( SELECT id FROM table ), ',' ) will get a result like: 1,2,3 4,5,6
Jester Aug 10 '12 at 11:11 2012-08-10 11:11
source share