Merge or Join two tables

5471
8
05-04-2017 10:03 AM
KnudsonLp
New Contributor

I have Table A

  V        X        Y      Z

123      4        5       8

124      4        5       9

125      4        5       10

125      4        6       11

123      5        5       12

And Table B

V          X       Y       

123      4        5

125      4        5

How to merge or join them together and get

V          X       Y       Z

123      4       5        8

125      4       5        10

Thank you so much

0 Kudos
8 Replies
AdrianWelsh
MVP Honored Contributor

Knudson,

If they're just tables and not databases or spatial files, you could simply do this in Excel by using VLOOKUP or other similar functions. Are you using GIS? What version, what software? You could perform the JOIN geoprocessing method on these tables.

Joining attributes in one table to another—Help | ArcGIS for Desktop 

0 Kudos
KnudsonLp
New Contributor

Thanks for reply. But they are spatial files, not just tables. I am Using ArcGIS 10.3.1. Can you explain more about the JOIN geoprocessing method?

0 Kudos
AdrianWelsh
MVP Honored Contributor

Take a look at the link above. It has information on joining tables (plus additional links for additional resources):

Joining attributes in one table to another—Help | ArcGIS for Desktop 

This link explains the joining process in greater detail:

Essentials of joining tables—Help | ArcGIS for Desktop 

0 Kudos
KnudsonLp
New Contributor

Yes, I have read those links before. But the join is only based on one same datafield, but I want to keep the records only when all three datafields match to the another table.

0 Kudos
XanderBakker
Esri Esteemed Contributor

If the example you provided is accurate, it seems to be simple selection those records from table A that have a matching value "V" in table B. This could be done using a relate between the two tables, select the records from Table B, propagate the selection to table A and export the selection to create the table or featureclass you want.

See: Accessing related records—Help | ArcGIS Desktop 

0 Kudos
KnudsonLp
New Contributor

Thank you for your reply. But it is not that simple, there are several items have the same V Value. I want to keep the records only if all three Datafield V, X, Y matching the another table.

0 Kudos
curtvprice
MVP Esteemed Contributor

ArcGIS joins support only one field, not multiple fields. 

A workaround that people sometimes do is concatenate fields, that is create a string field in both tables that includes all the data, for example "123_4_5" and use that as a join field.

If the datasets are in a file geodatabase, you can do a more complex query using the Make Query Table tool. This is limited to only some data formats and familiarity with SQL is recommended. There are good example in the help fortunately. The general approach for this is to do a many to many join on one of the fields and then query for rows that match your multiple fields. 

Make Query Table—Help | ArcGIS for Desktop 

KnudsonLp
New Contributor

Thank you! These are great tricks.

0 Kudos