See these two example tables:
Table 1:
id acc_no name
------------------------
1 14 aaaa
2 16 bbbb
3 18 ccccc
4 25 wwww
5 27 xxxxxxx
6 28 zzzzzzz
Table 2:
sr no acc_no amount
----------------------
1 14 2000
2 16 2344
3 18 3200
I need to get acc_no based entries that do not match in table 1, for example:
CONCLUSION:
id acc_no name
---------------------
4 25 wwww
5 27 xxxxxxx
6 28 zzzzzzz
When I tried with the request below, the result was unreliable:
SELECT t1.*
FROM table1 t1
LEFT OUTER JOIN table2 t2 ON t1.acc_no = t2.acc_no
WHERE t2.acc_no IS NULL
Give your suggestions. What will be the correct ti SQL query to get above the output?
source
share