(search identifying data set 1) OR (search identifying data set 2) | stats values(field1) as field1 ... by common_field
The general assumption here is to have one event per "GCDn" on the left and one event per "id n" on the right, the stats stitches them together.
In your case you may need to do a bit of preprocessing, for example your first data set seems to have values like "GCD1" while the second data set appears to have values like "id 1" - those field values need to be harmonized before the stats, e.g. like this:
() OR () | eval common_field = case(expression identifying data set 1, replace(field_from_data_set_1, "GCD", ""), expression identifying data set 2, replace(field_from_data_set_1, "id ", ""), true(), "unknown id") | stats ...