title: Oracle: function based index selective uniqueness
body: <p>I have to maintain history and so I am using is_deleted column which can have 'Y' or 'N'. But for any instance of is_deleted 'N' I should have uniwue entry for (a,b,c) composite columns.</p>
  
  <p>When I am tryin to create function based unique index I am getting error.</p>
  
  <pre><code>CREATE UNIQUE INDEX fn_unique_idx ON table1  (CASE WHEN is_deleted='N' then (id, name, type) end);
  </code></pre>
  
  <p>ERROR at line 1:
  ORA-00907: missing right parenthesis</p>
  
  <p>Please help.</p>
  
  <p>Thanks</p>