SQL-Find the unique records from two tables ?

Q.

Table_A
Sl_no
1
2
3
4
Table_B
Sl_no
1
2

output should be only 3&4 without using minus or exists just using left join .

left join

Select a.sl_no from table_A a,table_B b 
Where a.sl_no=b.sl_no(+) And b.sl_no is null;

minus

Select * from table_a 
minus 
select * from table_b;

output

SQL- query to find out the distinct values from two tables

Leave a Reply