Write a SQL query to find records in Table A that are not in Table B without using NOT IN operator.

Consider two tables
Table_A
10
20
30

Table_B
15
30
45

Answer: We can use MINUS operator in this case for Oracle and EXCEPT for SQL Server.

Query will be as follows:

SELECT * FROM Table_A
MINUS
SELECT * FROM Table_B

Read the full book at www.amazon.com
Posted in SQL, SQL Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*