<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic One to Many Relate - Make Query Table in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/one-to-many-relate-make-query-table/m-p/682551#M2273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: SStrand&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just cannot wrap my head around using the Make Query Table help section work with a python script to relate a set of points to multiple table records.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a set of points with an ID field and a table with the same ID field occurring multiple times with different values for each. I need a list of those values. Could anyone help with this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Apr 2013 19:11:52 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2013-04-11T19:11:52Z</dc:date>
    <item>
      <title>One to Many Relate - Make Query Table</title>
      <link>https://community.esri.com/t5/transportation-questions/one-to-many-relate-make-query-table/m-p/682551#M2273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: SStrand&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just cannot wrap my head around using the Make Query Table help section work with a python script to relate a set of points to multiple table records.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a set of points with an ID field and a table with the same ID field occurring multiple times with different values for each. I need a list of those values. Could anyone help with this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 19:11:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/one-to-many-relate-make-query-table/m-p/682551#M2273</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-04-11T19:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: One to Many Relate - Make Query Table</title>
      <link>https://community.esri.com/t5/transportation-questions/one-to-many-relate-make-query-table/m-p/682552#M2274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: JSkinn3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Steve,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't believe the Make Query Table will not show a 1-Many relationship.&amp;nbsp; What you could do is iterate through your first table and append the IDs to a list.&amp;nbsp; Then, iterate through the list and find all related records to the ID and print out the corresponding attributes.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy from arcpy import env env.workspace = r"C:\temp\python\test.gdb"&amp;nbsp; table1 = "Gages" table2 = "Mains"&amp;nbsp; table1List = []&amp;nbsp; #append IDs to list rows = arcpy.SearchCursor(table1) for row in rows: &amp;nbsp;&amp;nbsp;&amp;nbsp; table1List.append(row.getValue("ID"))&amp;nbsp; del row, rows&amp;nbsp; table2List = []&amp;nbsp; #iterate through list and find related records for n in table1List: &amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(table2) &amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if n == row.ID: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #append related records to a new list &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table2List.append(row.X) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table2List.append(row.Y) &amp;nbsp;&amp;nbsp;&amp;nbsp; print str(n) + "\n\t" + str(table2List) &amp;nbsp;&amp;nbsp;&amp;nbsp; #clear list for next ID &amp;nbsp;&amp;nbsp;&amp;nbsp; table2List = []&amp;nbsp; del row, rows&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 13:50:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/one-to-many-relate-make-query-table/m-p/682552#M2274</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-04-12T13:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: One to Many Relate - Make Query Table</title>
      <link>https://community.esri.com/t5/transportation-questions/one-to-many-relate-make-query-table/m-p/682553#M2275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: SStrand&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi JSkinn,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the suggestion to work around this, I will give it a try!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 15:14:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/one-to-many-relate-make-query-table/m-p/682553#M2275</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-04-12T15:14:04Z</dc:date>
    </item>
  </channel>
</rss>

