Hello, I'd like to know how to draw a field that I do not have on another table. logically would be like this "selects code of the document in table x where the code of the document does not exist in table and";
Hello, I'd like to know how to draw a field that I do not have on another table. logically would be like this "selects code of the document in table x where the code of the document does not exist in table and";
Since the tables are x and y , as mentioned, both have the cpf field, for example, the following query returns all existing CPFs in x that do not exist in and :
SELECT
cpf
FROM
x
WHERE
cpf NOT IN (SELECT cpf FROM y)
And the following are all the CPFs that exist in y but not in x :
SELECT
cpf
FROM
y
WHERE
cpf NOT IN (SELECT cpf FROM x)
The comparison criterion (s) (here was used CPF) you will have to define, based on one / some of the columns simultaneously existing in the two tables.