question

wm-man avatar image
wm-man asked

How to join? Missing values right and left

Hi, please can you help me? I have Table_A and Table_B: Table_A:
Nr | Value_A
1 | 100
3 | 300
Table_B:
Nr | Value_B
2 | 200
3 | 600
How can I join TableA and TableB for the result: Nr | ValueA | ValueB
1 | 100 | null
2 | null | 200
3 | 300 | 600
Thank you very much!
joinsjoin
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mjharper avatar image
mjharper answered
I haven't tested this - but think it will work: SELECT ISNULL( a.Nr, b.Nr) as Nr , a.ValueA , b.ValueB FROM TABLE_A FULL OUTER JOIN TABLE_B ON a.Nr = b.Nr
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

wm-man avatar image
wm-man answered
Thank you!!! It works!
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.