title: How to return distinct records based on two different values
body: <p>I have the following sample of data in an Oracle table called MY_ATTRIBUTES:</p>
  
  <pre><code>Date        Emp_No  Attribute
  -----------------------------------------------------
  01/04/2012  1234567 APPLE
  01/04/2012  1234567 ORANGE
  01/04/2012  1234567 PINEAPPLE
  01/04/2012  1234567 BANANA
  01/04/2012  8888888 APPLE
  01/04/2012  8888888 ORANGE
  01/04/2012  2222222 APPLE
  01/04/2012  2222222 ORANGE
  01/04/2012  2222222 PINEAPPLE
  </code></pre>
  
  <p>Based on the above sample data, I need to return only the distinct records using only Date and Emp_No where these records contains data that have both the Attributes of ‘APPLE’ and ‘PINEAPPLE’</p>
  
  <p>So based on this criteria, I would expect the following two result records only, i.e.:</p>
  
  <pre><code>01/04/2012  1234567
  01/04/2012  2222222
  </code></pre>
  
  <p>I am looking to write an Oracle SQL query that will return this result set based on the criteria described.</p>
  
  <p>I should also point out that I need this SQL query to be used as a sub-query off the main SELECT.</p>