I have the following query that checks if two columns of a table are in
another
The query works, I hope you can optimize the call in because they are equal. I doubt if there is a performance penalty because two calls are made to the same query
SELECT name,lastname FROM TABLA_A
WHERE
name IN (
SELECT name FROM TABLE_B
)
OR
lastname IN (
SELECT lastname FROM TABLE_B
)
ANOTHER WAY
SELECT a.name,a.lastname
FROM TABLE_A as a
join TABLE_B as b on a.name=b.name
or a.lastname= b.lastname
try to join, is a valid option? there are other ways to make this task more efficient? thank you very much