Monday 3 September 2018
Subscribe to:
Post Comments (Atom)
Table A
ID - Val1 - Val2
1 - 2 - 2
2 - 3 - 3
4 - 1 - 5
Table B
ID - Val1 - Val2
2 - 3 - 3
3 - 2 - 1
4 - 2 - 3
Result
ID - Val1A - Val2A - Val1B - Val2B
1 - 2 - 2 - NULL - NULL
2 - 3 - 3 - 3 - 3
3 - NULL - NULL - 2 - 1
4 - 1 - 5 - 2 - 3
select coalesce(a.id,b.id) as ID, Val1A , Val2A , Val1B , Val2B
from TableA a
Full outer join tableB b
ON <.....>
Hello Friends! I am Ramana a part time blogger from Hyderabad.
0 comments:
Post a Comment