I'm trying to delete from a table using where clause while passing it an array.
DELETE FROM Btemp
WHERE col2 =
(SELECT ARRAY((SELECT col2 FROM Atemp INTERSECT SELECT col2 FROM Btemp)));
I'm getting this error:
ERROR: operator does not exist: character varying = character varying[]
LINE 2: WHERE col2 =
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
SQL state: 42883
And if do it without array, like below
DELETE FROM Btemp
WHERE col2 =
(SELECT col2 FROM Atemp INTERSECT SELECT col2 FROM Btemp);
I get error:
ERROR: more than one row returned by a subquery used as an expression
What should I do?