It would be nice if I could perform a definition query based on fields in a related table in a 1:M or M:M relationship.
@ChrisFoxI had never tried the SQL syntax you outlined, but this expression does work in ArcMap and ArcGIS Pro for related data in the same geodatabase. This syntax is only briefly discussed in the Subqueries section of the SQL reference for query expressions used in ArcGIS website. That section doesn't include an example that was quite as clear or useful to me as the one you have given. I frankly would like to see your example added to that section, since if it had been there years ago I would have been much more likely to see the usefulness of this approach and not had to develop some of the workarounds I came up with.
Your example works for file geodatabases as well, despite the warning that file geodatabases only offer limited support for subqueries. The Subqueries section basically says that help for using them is specific to the DBMS documentation of my enterprise geodatabase. Since I've mostly worked with file geodatabases that limitation warning had kept me from even trying to figure out or use Subqueries, but based on the example you have outlined I believe I actually now have a use for them. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.