SQL JOIN,LEFT JOIN,RIGHT JOIN

66 Views Asked by At

I have 3 tables like

TAB_1

ID NUMBER
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
10 110

TAB_2

ID NUMBER
1 101
2 102
3 105

TAB_3

ID NUMBER
1 104
2 107
3 110

The output needs to be:

ID NUMBER
1 103
2 106
3 108
4 109
1

There are 1 best solutions below

1
Kadir Turan On

I think u can use NOT IN with Subqueries

Like;

SELECT
    *
FROM
    Table_1
WHERE
    Number NOT IN (Select number from Table_2) and
    Number NOT IN (Select number from Table_3)