I’d like to set up a sql query where I have a bunch of varchar values that correspond to a column of a specific database table. The result should give me all values that are not in the table column.
Something like this:
SELECT x.a
FROM ( SELECT ('1','2','3') AS a ) x
WHERE x not in (
SELECT knr
FROM table
)
I didn’t get this to work because the inner select is treated as a single record I don’t know how to set it up right, or if this is even possible.
Can anyone give me a hint how to archive this?
Postgres has implemented the Table Values Constructor syntax, so you can use this, too: