<?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 SQL statement to extract attribute data from a single table in Oracle in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811462#M3198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have a single table in an Oracle database&amp;nbsp;that has&amp;nbsp;different unique feature class codes in the same table relating to main (CODE = 76000) &amp;nbsp;and pipe samples (CODE = 77030) taken against the mains.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know how top grab attributes from the two feature classes without having to run multiple sql statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got to the same result by running multiple sql statements via the 'IN CLAUSE' so just want to further my skills.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: medium; font-family: Calibri;"&gt;&lt;SPAN style="color: #000000;"&gt;I wanted to generate a single piece of SQL to grab the items in &lt;/SPAN&gt;&lt;SPAN style="color: red;"&gt;RED&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; from a different feature class than 77030 i.e. the mains class&amp;nbsp; The ones in &lt;/SPAN&gt;&lt;SPAN style="color: red;"&gt;RED&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; relate to the main that the pipe sample is attached to and come from a feature code of &lt;SPAN style="color: #000000; font-family: Calibri; font-size: medium;"&gt;76000.&lt;/SPAN&gt;. I think I needed an inner join.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: medium; font-family: Calibri;"&gt;the S_IPID relates to the pipe sample and the S_PARENT_IPID relates to the main that the pipe sample is attached to. Hence we have the join, but I do not know how to grab the attributes in RED from the mains attributes&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: medium;"&gt;select S_IPID,&lt;BR /&gt; S_PARENT_IPID, &lt;BR /&gt; U_DATE_PIPE_SAMPLE, &lt;BR /&gt; S_XCOORD_A, &lt;BR /&gt; S_YCOORD_A, &lt;BR /&gt; U_CONDITION_GRADE,&lt;BR /&gt; U_GROUND_TYPE, &lt;BR /&gt; U_PIPE_SAMPLE_REF, &lt;BR /&gt; U_REASON, &lt;BR /&gt; U_STREET, &lt;BR /&gt; U_SURFACE_USE, &lt;BR /&gt; U_TOWN,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: medium; font-family: Calibri;"&gt;&lt;SPAN style="color: red;"&gt;U_MATERIAL,&lt;BR /&gt; U_DIAMETER,&lt;BR /&gt; U_DATE_INSTALLED,&lt;BR /&gt; U_DATE_REHABILITATED &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt; from sdf_asset_all&lt;BR /&gt; where S_FCODE=77030&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Jun 2018 11:21:34 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2018-06-05T11:21:34Z</dc:date>
    <item>
      <title>SQL statement to extract attribute data from a single table in Oracle</title>
      <link>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811462#M3198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have a single table in an Oracle database&amp;nbsp;that has&amp;nbsp;different unique feature class codes in the same table relating to main (CODE = 76000) &amp;nbsp;and pipe samples (CODE = 77030) taken against the mains.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know how top grab attributes from the two feature classes without having to run multiple sql statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got to the same result by running multiple sql statements via the 'IN CLAUSE' so just want to further my skills.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: medium; font-family: Calibri;"&gt;&lt;SPAN style="color: #000000;"&gt;I wanted to generate a single piece of SQL to grab the items in &lt;/SPAN&gt;&lt;SPAN style="color: red;"&gt;RED&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; from a different feature class than 77030 i.e. the mains class&amp;nbsp; The ones in &lt;/SPAN&gt;&lt;SPAN style="color: red;"&gt;RED&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; relate to the main that the pipe sample is attached to and come from a feature code of &lt;SPAN style="color: #000000; font-family: Calibri; font-size: medium;"&gt;76000.&lt;/SPAN&gt;. I think I needed an inner join.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: medium; font-family: Calibri;"&gt;the S_IPID relates to the pipe sample and the S_PARENT_IPID relates to the main that the pipe sample is attached to. Hence we have the join, but I do not know how to grab the attributes in RED from the mains attributes&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: medium;"&gt;select S_IPID,&lt;BR /&gt; S_PARENT_IPID, &lt;BR /&gt; U_DATE_PIPE_SAMPLE, &lt;BR /&gt; S_XCOORD_A, &lt;BR /&gt; S_YCOORD_A, &lt;BR /&gt; U_CONDITION_GRADE,&lt;BR /&gt; U_GROUND_TYPE, &lt;BR /&gt; U_PIPE_SAMPLE_REF, &lt;BR /&gt; U_REASON, &lt;BR /&gt; U_STREET, &lt;BR /&gt; U_SURFACE_USE, &lt;BR /&gt; U_TOWN,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: medium; font-family: Calibri;"&gt;&lt;SPAN style="color: red;"&gt;U_MATERIAL,&lt;BR /&gt; U_DIAMETER,&lt;BR /&gt; U_DATE_INSTALLED,&lt;BR /&gt; U_DATE_REHABILITATED &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000;"&gt; from sdf_asset_all&lt;BR /&gt; where S_FCODE=77030&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2018 11:21:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811462#M3198</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-06-05T11:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: SQL statement to extract attribute data from a single table in Oracle</title>
      <link>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811463#M3199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; border: 0px; font-size: medium;"&gt;If I understand it right, you are looking for a SQL Statement that queries the same table but get the parent pipes values for each pipe which is also in that table.&amp;nbsp; Also remember if you are using a versioned table, you should be pulling from the sdf_asset_all_evw view instead of it's base table.&amp;nbsp; Since I don't table, I haven't test this but it should give you them main idea.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;select&lt;/SPAN&gt; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;S_IPID&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;S_PARENT_IPID&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_DATE_PIPE_SAMPLE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;S_XCOORD_A&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;S_YCOORD_A&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_CONDITION_GRADE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_GROUND_TYPE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_PIPE_SAMPLE_REF&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_REASON&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_STREET&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_SURFACE_USE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_TOWN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mainPipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_MATERIAL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mainPipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_DIAMETER&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mainPipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_DATE_INSTALLED&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mainPipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;U_DATE_REHABILITATED 
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; sdf_asset_all &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; samplePipe&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sdf_asset_all &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; mainPipe
&lt;SPAN class="keyword token"&gt;where&lt;/SPAN&gt; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;S_FCODE&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;77030&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; samplePipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;S_PARENT_IPID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;mainPipe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;S_IPID&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:32:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811463#M3199</guid>
      <dc:creator>KevinDunlop</dc:creator>
      <dc:date>2021-12-12T09:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: SQL statement to extract attribute data from a single table in Oracle</title>
      <link>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811464#M3200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="screen shot of table" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/410600_2018_06_05_13_43_38_invalid_syntax_Word.png" /&gt;i get the gist of it but when running this within TOAD I get an invalid syntax see attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2018 12:44:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811464#M3200</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-06-05T12:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: SQL statement to extract attribute data from a single table in Oracle</title>
      <link>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811465#M3201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, try removing the AS keywords.&amp;nbsp; They are not used with table names in Oracle.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2018 14:11:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811465#M3201</guid>
      <dc:creator>KevinDunlop</dc:creator>
      <dc:date>2018-06-05T14:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: SQL statement to extract attribute data from a single table in Oracle</title>
      <link>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811466#M3202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A big thanks Kevin this as now worked by taking out the 'as' from the clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This one now saved in the memory bank for future reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2018 09:28:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/sql-statement-to-extract-attribute-data-from-a/m-p/811466#M3202</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-06-06T09:28:57Z</dc:date>
    </item>
  </channel>
</rss>

