1

I have two tables:

enter image description here

I am looking for the results like mentioned in the last.

I tried union (only similar col can be merged), left join, right join i am getting repeated fields in Null areas what can be other options where i can get null without column repeating

jarlh
  • 40,041
  • 8
  • 39
  • 58
usr5860
  • 13
  • 5

2 Answers2

0

A full join would get all results from both tables.

select
A.ID,
A.ColA,
A.ColB,
B.ColC,
B.ColD
from TableA A
full join Table B on A.ID = B.ID

Here is a good post to understand joins

dbajtr
  • 1,984
  • 2
  • 14
  • 20
0

You can try distinct:

select distinct * from 
tableA a, 
tableB b 
where a.id = b.id;

It will not give any duplicate tuples.

Pritam Banerjee
  • 16,584
  • 10
  • 80
  • 99