title: Oracle - update , decode and set value
body: <p>I have a table e.g. </p>
  
  <pre><code>**Fruit   Number**
  Apple     5
  Grape     9
  Orange    1
  Coconut   54
  Mango     22
  </code></pre>
  
  <p>I want to :</p>
  
  <ol>
  <li>Select the whole list</li>
  <li>Put 'Apple, Mango,Coconut' at top of the list. </li>
  <li>Update the current order, where number = rownum </li>
  </ol>
  
  <p>The list should look as follows : </p>
  
  <pre><code>**Fruit   Number**
  Apple     1
  Mango     2
  Coconut   3
  Grape     4
  Orange    5
  </code></pre>
  
  <p>I tried the following however getting syntax issues .. </p>
  
  <pre><code>update tablename 
  set id = rownum
  where fruit in (select fruit from table order by decode(fruit,'Apple',1,'Mango',2,'Coconut',3))
  </code></pre>