Use a Table to Select Records in another Table

1406
2
Jump to solution
06-25-2014 03:08 PM
GordonBooth
New Contributor III
I have a large geodatabase table (version 10.2.1) with traffic tickets (Table A). Every morning I receive a small table of voided traffic tickets (Table B) that need to be deleted from Table A. I will use Model Builder to create a python script. The script would run daily.
The question is how do I use Table B to select records in Table A?
Thanks for your help.
0 Kudos
1 Solution

Accepted Solutions
T__WayneWhitley
Frequent Contributor
Although not certain how well this will perform for you, and since you are using ModelBuilder, I suppose the easiest most straightforward way may be to use Add Join with the option to only keep joined rows, then execute a Deleted Features (or Delete Rows) to remove those rows.  Without seeing your data, I suppose you have a common field to join by and this is essentially how you have been doing it by hand?  If you're having problems with the join, particularly with the filtering option to keep only the join rows, there are other options -- for example, leave in the default keep all option on add join, then use Make Feature Layer or Select Layer By Attributes (or even Make Table View) to make the selection for 'is not null' to capture the joined rows before proceeding with your delete rows operation.

Wayne

View solution in original post

0 Kudos
2 Replies
T__WayneWhitley
Frequent Contributor
Although not certain how well this will perform for you, and since you are using ModelBuilder, I suppose the easiest most straightforward way may be to use Add Join with the option to only keep joined rows, then execute a Deleted Features (or Delete Rows) to remove those rows.  Without seeing your data, I suppose you have a common field to join by and this is essentially how you have been doing it by hand?  If you're having problems with the join, particularly with the filtering option to keep only the join rows, there are other options -- for example, leave in the default keep all option on add join, then use Make Feature Layer or Select Layer By Attributes (or even Make Table View) to make the selection for 'is not null' to capture the joined rows before proceeding with your delete rows operation.

Wayne
0 Kudos
GordonBooth
New Contributor III
Wayne:
Thanks for taking the time to answer my question. Here's what worked for me:  "other options -- for example, leave in the default keep all option on add join, then use" Select Layer By Attributes" to make the selection for 'is not null' to capture the joined rows before proceeding with your delete rows operation."
Thanks again! Have a great weekend.
0 Kudos