I need to join 2 tables where each table's entire row is unique however there are duplicates on the key I am joining on which results in multiple duplicates. Refer to example below:
Table A: Table B:
Primary_Key Variable_A1 Primary Key Variable_B1 Variable_B2
A 1 A 5 6
B 2 A 7 8
C 3 C 5 0
What happens when joining is the following:
Primary Key Variable_A1 Variable_B1 Variable_B2
A 1 5 6
A 1 7 8
A 1 5 8
A 1 7 6
Where I only require the below which is the joining of the unique rows:
Primary Key Variable_A1 Variable_B1 Variable_B2
A 1 5 6
A 1 7 8
Thus I require a code where SQL acknowledges that Variable_B1 with Variable_B2 is unique and not break it up which results in the duplicates