title: SQL query join based on condition
body: <p>I have two tables "customer" and "activation" that I would like to join. Here are their structures:</p>
  
  <pre><code> CUSTOMER                       Activation
   ------------                  ------------- 
   Id      Name                   EntityId       Date_Created       Type
   1       A                         1               2012            EMAIL
   2       B                         2               2011            SMS
   3       C
  </code></pre>
  
  <p>Now, I would like to join those two tables on customer.Id = Activation.EntityId.  However, i want my final table structure to be like this: </p>
  
  <pre><code> Id    Name    Date_Email       Date_SMS       
  
   1      A        2012             NULL
   2      B        NULL             2011
  </code></pre>
  
  <p>Basically, the columns Date_Email and Date_SMS both come from Activation.Date_Created column. IF Activation.Type is EMAIL, i set Date_Email in my final result to Date_created and set Date_SMS to null. If Activation.type is SMS, i do it the other way. </p>
  
  <p>What i have right now is this:</p>
  
  <pre><code>SELECT Customer.Id, Name, Date_Created AS Date_EMail, DATE_Created AS Date_SMS 
  from Customer 
  inner join Activation ON Customer.Id = Activation.EntityId;
  </code></pre>
  
  <p>Now, i need to make a If-else condition based on Activation.Type column. I am quite new to this and I have not been able to figure this out by googling. I am using Oracle XE database btw</p>
  
  <p>Can someone help me with this? Thanks</p>