I have declared an array variable as
select array(select "account_id" from [some where clause]) as negateArray;
Note that I return a single column. Now I need to use it in another WHERE-clause that should mean: do NOT include data if account_id matches any of found in negateArray.
I write something like
select * from [some other where clause] WHERE (account_id NOT IN ANY(negateArray));
but I am getting a syntax error. What would be the correct way to write the condition for PostgreSQL?
select array(select "account_id" from [some where clause]) as negateArray;this not creates variable.