title: Select multiple column values in single query - oracle
body: <p>I have two tables that store email information:</p>
  
  <ul>
  <li>EMAIL</li>
  <li>EMAIL_ADDRESS</li>
  </ul>
  
  <p>EMAIL has:</p>
  
  <ul>
  <li>email ID</li>
  <li>timestamp</li>
  <li>and other info we don't care about</li>
  </ul>
  
  <p>EMAIL_ADDRESS has:</p>
  
  <ul>
  <li>ID (foreign key references EMAIL.ID)</li>
  <li>EMAIL_ADDRESS</li>
  <li>TYPE (to, from)</li>
  </ul>
  
  <p>Say I have 6 rows in EMAIL - the query should return the ID, timestamp, to and from address.</p>
  
  <p>At the moment I have this:  </p>
  
  <pre><code>SELECT ea.EMAIL_ADDRESS, e.ID, e.sent_date
  FROM EMAIL_ADDRESS ea, CHANN_EMAIL e
  WHERE e.ID=ea.id
  AND ea.TYPE in ('to','from')
  </code></pre>
  
  <p>This returns 12 rows, in the format:
  -to, ID, date
  -from, ID, date</p>
  
  <p>What would the query be so I would have 6 rows with:
  -to, from, ID, date</p>