I have 2 tables which look like:
Table A
key1 key2 key3
1 a a
2 a a
3 a a
Table B
key1 key2 key3
1 xxx zzz
2 yyy www
Now i want to have a big table out of A and B
where A.key1 matches B.key1 the content of B is pasted
otherwise if no key1 matches default values are pasted
for example
Key1 Key2 Key3 Key5 Key6
1 a a xxx zzz
2 a a yyy www
3 a a 0 0
What is the query?
(this will give nulls for the b columns where there is no matching row from b)