@sebastianmendez wrote: Well, i thought i did that. You can see the ID 1 is present in both tables. And the desired result is keep the observation (ID1) from the table 2.
I should have provided an example of what I meant. Sorry, but I couldn't edit your pictures.
Stealing from @PeterClemmensen , suppose that your data actually looked like
(the simpler case of only one data set with duplicate id values:
Case 1: data set One is the only one with duplicates of ID
data one;
input ID X $;
datalines;
1 a
1 z
2 b
3 a
4 b
5 b
6 c
;
data two;
input ID X $;
datalines;
1 c
8 b
9 b
;
Case 2: where data set 2 has duplicates of Id
data one;
input ID X $;
datalines;
1 a
2 b
3 a
4 b
5 b
6 c
;
data two;
input ID X $;
datalines;
1 c
1 w
8 b
9 b
;
Case 3: both sets have duplicates of Id
data one;
input ID X $;
datalines;
1 a
1 h
1 m
1 s
2 b
3 a
4 b
5 b
6 c
;
data two;
input ID X $;
datalines;
1 c
1 z
8 b
9 b
;
If you have any of these cases you need to consider what you expect for a result and show that. The last one can be very complicated depending on exact expectation.
... View more