title: Oracle SQL - Comparing Rows
body: <p>I have a problem I'm working on with Oracle SQL that goes something like this.</p>
  
  <p>TABLE  </p>
  
  <pre><code> PurchaseID    CustID      Location  
  ----1------------1-----------A  
  ----2------------1-----------A    
  ----3------------2-----------A  
  ----4------------2-----------B  
  ----5------------2-----------A  
  ----6------------3-----------B  
  ----7------------3-----------B  
  </code></pre>
  
  <p>I'm interested in querying the Table to return all instances where the same customer makes a purchase in different locations. So, for the table above, I would want:</p>
  
  <p>OUTPUT  </p>
  
  <pre><code>PurchaseID    CustID      Location  
  ----3------------2-----------A  
  ----4------------2-----------B  
  ----5------------2-----------A  
  </code></pre>
  
  <p>Any ideas on how to accomplish this? I haven't been able to think of how to do it, and most of my ideas seem like they would be pretty clunky. The database I'm using has 1MM+ records, so I don't want it to run too slowly.</p>
  
  <p>Any help would be appreciated. Thanks!</p>