title: How get non common values from 2 different column of 2 Different table
body: <p>I wrote one query from where i able to achieved below outcome. But due to lack of understanding in SQL not sure is there any function or way that I could achieve Expected outcome shown in 2nd table.</p>
  <p>Current result  from my queries with listagg function:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>val1</th>
  <th>val2</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>666</td>
  <td>1151</td>
  <td>1151</td>
  </tr>
  <tr>
  <td>667</td>
  <td>1151</td>
  <td>2120</td>
  </tr>
  <tr>
  <td>668</td>
  <td>2120</td>
  <td>2120</td>
  </tr>
  <tr>
  <td>669</td>
  <td>2120</td>
  <td>(null)</td>
  </tr>
  <tr>
  <td>670</td>
  <td>1116,2120</td>
  <td>1116,2120,1151</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>where:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>val1</th>
  <th>val2</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>670</td>
  <td>1116,2120</td>
  <td>1116,2120,1151</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>from this  last row: picking only not matching value and showing
  as below outcome for 670 id.</p>
  <p>Expected outcome:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>val1</th>
  <th>val2</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>667</td>
  <td>1151</td>
  <td>2120</td>
  </tr>
  <tr>
  <td>669</td>
  <td>2120</td>
  <td>(null)</td>
  </tr>
  <tr>
  <td>670</td>
  <td>(null)</td>
  <td>1151</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I'm not sql developer so  get confuse how could i acheive this</p>
  <p>my query :</p>
  <pre><code>select   zone1.Id,zone1.VAL1,zone1.Org,zone2.VAL1,zone2.staff_ids
          from (   SELECT ta1.Id,  ta1.VAL1,ta1.P_DATE,ta1.Org 
                       FROM vw_summary ta1 LEFT JOIN tbl_staff t3 ON t3.staff_id in(ta1.Org) ) zone1
           left  join
                 ( SELECT        tb1.advice_id, tb1.VAL1,
           listagg(t1.ID, ',') within group (order by tb1.VAL1) as staff_ids
                      FROM vw_advice tb1 
                      LEFT JOIN tbl_issue t1 ON tb1.VAL1 = t1.VAL1                 
                      GROUP BY  tb1.advice_id, tb1.VAL1
                    )  zone2 on zone1.VAL1=zone2. VAL1
          where P_DATE LIKE '%-22%'   
          GROUP by  zone1.Id,zone1.VAL1,zone1.Org,zone2.VAL1,zone2.staff_ids
          order by  zone1.VAL1 asc; 
  </code></pre>