<?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 Join Same Table More Than Once in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/568973#M160267</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;I'm aiming for a result set where I'll see a column a in the MDM.MPI_MEMPHONEWC Table two times. Therefore,&lt;BR /&gt;I've put in my code an inner join on that table that joins the tables to itself.
My question is is what I've got below follow true to what I'm trying to accomplish with MDM.MPI.MEMPHONEWC table.&lt;BR /&gt;&lt;BR /&gt;NI'm not looking for replies to know what my table column values are.  I'm looking for just an overall code review&lt;BR /&gt;oof does it make sense.

FROM
HSDREPT.MEMBER_ADDRESS as MA 
inner join HSDREPT.MEMBER_MASTER as MM
    on MM.SEQ_MEMB_ID = MA.SEQ_MEMB_ID 
inner join HSDREPT.member_elig_history as meh
    on MM.SEQ_MEMB_ID = MEH.SEQ_MEMB_ID 
inner join HSDREPT.PROV_MASTER as PM
    on PM.SEQ_PROV_ID = MEH.SEQ_PROV_ID 
inner join HSDREPT.PROV_ADDRESS as PA  
    on PM.SEQ_PROV_ID = PA.SEQ_PROV_ID
LEFT JOIN MDM.MPI_MEMIDENTWC AS MID
    on MM.SUBSCRIBER_ID = MID.IDNUMBER
inner join MDM.MPI_MEMADDRWC as MAD
    on MAD.MEMRECNO = MID.MEMRECNO 
inner join MDM.MPI_MEMPHONEWC as MP
    on MAD.MEMRECNO = MP.MEMRECNO
inner join MDM.MPI_MEMPHONEWC2 AS MPH
    on MP.MEMRECNO = MPH.MEMRECNO



&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Jun 2019 02:01:47 GMT</pubDate>
    <dc:creator>req41273</dc:creator>
    <dc:date>2019-06-26T02:01:47Z</dc:date>
    <item>
      <title>Join Same Table More Than Once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/568973#M160267</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;I'm aiming for a result set where I'll see a column a in the MDM.MPI_MEMPHONEWC Table two times. Therefore,&lt;BR /&gt;I've put in my code an inner join on that table that joins the tables to itself.
My question is is what I've got below follow true to what I'm trying to accomplish with MDM.MPI.MEMPHONEWC table.&lt;BR /&gt;&lt;BR /&gt;NI'm not looking for replies to know what my table column values are.  I'm looking for just an overall code review&lt;BR /&gt;oof does it make sense.

FROM
HSDREPT.MEMBER_ADDRESS as MA 
inner join HSDREPT.MEMBER_MASTER as MM
    on MM.SEQ_MEMB_ID = MA.SEQ_MEMB_ID 
inner join HSDREPT.member_elig_history as meh
    on MM.SEQ_MEMB_ID = MEH.SEQ_MEMB_ID 
inner join HSDREPT.PROV_MASTER as PM
    on PM.SEQ_PROV_ID = MEH.SEQ_PROV_ID 
inner join HSDREPT.PROV_ADDRESS as PA  
    on PM.SEQ_PROV_ID = PA.SEQ_PROV_ID
LEFT JOIN MDM.MPI_MEMIDENTWC AS MID
    on MM.SUBSCRIBER_ID = MID.IDNUMBER
inner join MDM.MPI_MEMADDRWC as MAD
    on MAD.MEMRECNO = MID.MEMRECNO 
inner join MDM.MPI_MEMPHONEWC as MP
    on MAD.MEMRECNO = MP.MEMRECNO
inner join MDM.MPI_MEMPHONEWC2 AS MPH
    on MP.MEMRECNO = MPH.MEMRECNO



&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jun 2019 02:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/568973#M160267</guid>
      <dc:creator>req41273</dc:creator>
      <dc:date>2019-06-26T02:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Join Same Table More Than Once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/568974#M160268</link>
      <description>&lt;P&gt;It is perfectly OK to join the same table more than once in a query, but when doing that there should be something different about the second or subsequent joins. From your code snippet I can't see anything different but you will need to change this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;MDM.MPI_MEMPHONEWC2 /* Why the 2 on the end? you dont need it if you are reading the same table&amp;nbsp;*/&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jun 2019 02:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/568974#M160268</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-06-26T02:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Join Same Table More Than Once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/569098#M160324</link>
      <description>&lt;P&gt;My goal is to have the same table available&amp;nbsp;for different where and select conditions.&amp;nbsp; So that's is why I put the 2 at the end.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;inner join MDM.MPI_MEMPHONEWC as MP

on MAD.MEMRECNO = MP.MEMRECNO

inner join MDM.MPI_MEMPHONEWC2 AS MPH

on MP.MEMRECNO = MPH.MEMRECNO &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jun 2019 13:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/569098#M160324</guid>
      <dc:creator>req41273</dc:creator>
      <dc:date>2019-06-26T13:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Join Same Table More Than Once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/569104#M160328</link>
      <description>&lt;P&gt;But, I think my alias names being different should differentiate the same table as being two different tables now.&amp;nbsp; correct?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 14:07:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/569104#M160328</guid>
      <dc:creator>req41273</dc:creator>
      <dc:date>2019-06-26T14:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Join Same Table More Than Once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/570382#M160821</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/275828"&gt;@req41273&lt;/a&gt;&amp;nbsp; - Yes, differentiate by alias, table name has to stay the same.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 20:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Join-Same-Table-More-Than-Once/m-p/570382#M160821</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-07-01T20:11:19Z</dc:date>
    </item>
  </channel>
</rss>

