I have the following query
select *
from Table1
where NUMid in (select array_agg(NUMid)
from Table2
where email = 'xyz@gmail.com')
My intention is to get the list of all the NUMids from table2 having an email value equal to xyz@gmail.com and use those list of NUMids to query from Table1.
But I am getting the following error:
value and result of subquery must be of the same type for IN expression: bigint vs array(bigint)
Basically IN clause cannot take in an array. Is there workaround for this problem.