I know that I can check codes that are in one table and are not in another with the following query :
SELECT cod FROM tabela1 WHERE cod NOT IN (SELECT cod FROM tabela2)
But how can I check the records that are not in a table but are in a comma separated list?
Example: Let's say I have a names table with the following data:
cod | nome
----|-----------------
1 | César
3 | Maurício
And I want to make a query by passing the following 1, 2, 3, 4
faults expecting the return to be 2, 4
which are codes that are not in the database.
How can I do this?