Skip to content
Advertisement

How to use a subquery in array_agg without using a join [closed]

I have a query that I would like to write wihout using a join and concat all phone numberes together from another table. The phone numbers are linked together by ink_id field.

I tried these query but both of them are giving me a syntax error.

or

Ink table

Phone number table

So the result should be

Advertisement

Answer

The second method would work, if you used the right syntax:

Subqueries need to be surrounded by parentheses.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement