-
I have a scenario where a subquery returns me an array of ids as below - select string_to_array(string_agg(concat(t1.id,',',t2.id),','),',') :: array(bigint) as ids Above query gives me expected result. But the problem is , _Error! I am already done trying Array Expressions etc. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Can you try with department.id = ANY(SELECT UNNEST(ids) FROM (t1, t2)) string_to_array(string_agg(concat(t1.id,',',t2.id),','),',') :: array(bigint) could be rewritten as array_agg(concat(t1.id,',',t2.id)) :: array(bigint) or could it not? |
Beta Was this translation helpful? Give feedback.
Can you try with
UNNEST
?could be rewritten as
or could it not?