title: How to Select all possible distinct related "two-ways" values for any given ID from a junction table?
body: <p>table TBL_IN &quot;IN Document details table&quot;</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>IID</th>
  <th>IDate</th>
  <th>ISubject</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>I-225</td>
  <td></td>
  <td></td>
  </tr>
  <tr>
  <td>I-300</td>
  <td></td>
  <td></td>
  </tr>
  <tr>
  <td>I-410</td>
  <td></td>
  <td></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>table TBL_OUT &quot;OUT Document details table&quot;</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>OID</th>
  <th>ODate</th>
  <th>OSubject</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>O-20</td>
  <td></td>
  <td></td>
  </tr>
  <tr>
  <td>O-35</td>
  <td></td>
  <td></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>table TBL_INOUT &quot;IN OUT Document Junction table&quot;</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>IOID</th>
  <th>IID</th>
  <th>OID</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>I-225</td>
  <td>O-20</td>
  </tr>
  <tr>
  <td>2</td>
  <td>I-225</td>
  <td>O-35</td>
  </tr>
  <tr>
  <td>3</td>
  <td>I-300</td>
  <td>O-35</td>
  </tr>
  <tr>
  <td>4</td>
  <td>I-410</td>
  <td>O-20</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Question is how to get the following query result in oracle sql or access query from the junction table?</p>
  <p>query QRY_INOUT_Related &quot;Select all possible related &quot;two-ways&quot; values for any given ID&quot;</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>IO_Related</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>O-20</td>
  <td>I-225,I410,O-35,I-300</td>
  </tr>
  </tbody>
  </table>
  </div><div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>IO_Related</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>I-300</td>
  <td>O-35,I-225,O-20,I-410</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I hope I clarified the idea as possible as I can.</p>