title: select rows and generate a new column based on condition SQL
body: <p>I have the following table in Oracle</p>
  
  <pre><code>Company   Rate   Period
  1A        10     sep-16
  1B        20     sep-15
  1C        30     oct-16
  1D        40     sep-16
  1A        50     oct-16
  2B        50     sep-15
  1C        60     oct-14
  </code></pre>
  
  <p>I want to select some rows and add a value based on conditions. so the result will be similar to the following:</p>
  
  <pre><code>Company   Rate   Period    Currency
  1A        50     oct-16    USD
  1C        30     oct-16    AED
  </code></pre>
  
  <p>In the previous table, I am selecting only the companies 1A, 1C where Period ='oct-16'. and I need to add a column "currency" for each company where 1A=USD, 1C=AED</p>
  
  <p>what I did is: </p>
  
  <pre><code>select company, PERIOD , Rate 
  from TABLE_test 
  where period='Oct-16' And Company='1A' 
      OR period='Oct-16' and Company='1C';
  </code></pre>
  
  <p>I managed to get the companies but failed at the currency column. is this possible using SQL command? please help.</p>