title: How to multiply data to get value | Oracle |
body: <p>I have 2 table <strong>Table 1 : Employee</strong> and <strong>Table 2 : Department</strong></p>
  <p><strong>Below is the join condition i have used</strong></p>
  <pre><code>select e.empsal,d.rate from employee e left join on department d where  e.empid = d.depid
  </code></pre>
  <p>Based on <code>d.rate</code> the value of <code>e.empsal</code> should get multiple , upto join condition i was able to do after that where to add case is not getting , if you see <code>drate</code> value will be anything
  if their are 25 drate values like : <code>1  2 4 6 7 9 14 36 67 8 2 4 19 11 8</code>
  It is not feasible to write that many times if conditions</p>
  <pre><code>case drate 
  if 0 then e.empsal*1
  if 1 then e.empsal*10
  if 2 then e.empsal*100
  if 4 then e.empsal*1000
  if 6 then e.empsal*1000000
  ...
  </code></pre>
  <p><strong>Example : Below is the logic and its Output expected:</strong></p>
  <pre><code>if d.rate value is 0 then  new_empsal=e.empsal * 1
  if d.rate value is 1 then  new_empsal=e.empsal * 10
  if d.rate value is 2 then  new_empsal=e.empsal * 100
  if d.rate value is 3 then  new_empsal=e.empsal * 1000
  will go on ...
  </code></pre>
  <p><strong>So the new values of</strong> <code>e.empsal</code> <strong>should be below</strong></p>
  <pre><code>EMPSAL,DRATE,NEW_EMPSAL
  1200,0,1200
  2345,1,23450
  1678,3,1678000
  2219,6,2219000000
  2458,1,24580
  2697,2,269700
  2936,1,29360
  3175,4,31750000
  3414,7,34140000000
  3653,2,365300
  3892,1,38920
  4131,1,41310
  4566,0,4566
  4131,4,41310000
  1000,6,1000000000
  345,1,3450
  2345,5,234500000
  1123,0,1123
  990,3,990000
  1100,3,1100000
  345,7,3450000000
  2345,2,234500
  </code></pre>
  <p><em><strong>How to achieve this below output using above condition ?</strong></em></p>