title: How to create unique index on fields with possible null values (Oracle 11g)?
body: <p>Here is the sample table with 3 columns (ID, UNIQUE_VALUE, UNIQUE_GROUP_ID)</p>
  
  <p>I want below records can be allowed:</p>
  
  <pre><code>(1, NULL, NULL)
  (2, NULL, NULL)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>(3, NULL, 7)
  (4, 123, 7)
  </code></pre>
  
  <p>or (<strong>Note: this condition is not allowed in <code>unique index</code> nor <code>unique constraint</code></strong>)</p>
  
  <pre><code>(5, NULL, 7)
  (6, NULL, 7)
  </code></pre>
  
  <p>and these can't be allowed:</p>
  
  <pre><code>(7, 123, 7)
  (8, 123, 7)
  </code></pre>
  
  <p>I created a unique index on last 2 columns, but only the first 2 examples can be allowed. </p>
  
  <p>Is it possible to let db check the uniqueness of these 2 columns only when both are not null?</p>