title: Remove Duplicates from LEFT OUTER JOIN
body: <p>My question is quite similar to <a href="https://stackoverflow.com/questions/757957/restricting-a-left-join">Restricting a LEFT JOIN</a>, with a variation.</p>
  
  <p>Assuming I have a table SHOP and another table LOCATION. Location is a sort of child table of table SHOP, that has two columns of interest, one is a Division Key  (calling it just KEY) and a "SHOP" number. This matches to the Number "NO" in table SHOP.</p>
  
  <p>I tried this left outer join:</p>
  
  <pre><code>SELECT S.NO, L.KEY
  FROM SHOP S
  LEFT OUTER JOIN LOCATN L ON S.NO = L.SHOP
  </code></pre>
  
  <p>but I'm getting a lot of duplicates since there are many locations that belong to a single shop. I want to eliminate them and just get a list of "shop, key" entries without duplicates. </p>
  
  <p>The data is correct but duplicates appear as follows:</p>
  
  <pre><code>SHOP     KEY
   1       XXX
   1       XXX
   2       YYY
   3       ZZZ
   3       ZZZ  etc.
  </code></pre>
  
  <p>I would like the data to appear like this instead:</p>
  
  <pre><code>SHOP     KEY
   1       XXX
   2       YYY
   3       ZZZ  etc.
  </code></pre>
  
  <p>SHOP table:</p>
  
  <pre><code> NO
   1       
   2       
   3       
  </code></pre>
  
  <p>LOCATION table:</p>
  
  <pre><code> LOCATION   SHOP  KEY
     L-1       1    XXX   
     L-2       1    XXX   
     L-3       2    YYY   
     L-4       3    YYY   
     L-5       3    YYY   
  </code></pre>
  
  <p>(ORACLE 10g Database)</p>