Reputation: 12053
How can convert result from query to array. For example
select ARRAY[x."Id"] as "id"
from public."jp_OnlyIds" as x
In above code, I get many rows with single element array, I want to get one array with all element, how can I do this?
I use Posgres database
Upvotes: 1
Views: 148
Reputation: 3778
You can try this:
select array_agg(x."id") as "id" from public."jp_OnlyIds" as x
Upvotes: 2