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
  • 42,561
  • 8
  • 45
  • 63
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
  • 2,024
  • 2
  • 14
  • 22
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
  • 17,953
  • 10
  • 93
  • 108