title: Identify NULL and assign bitmap
body: <p>I have a table</p>
  
  <p>table1</p>
  
  <pre><code>u_a_id  e_id   e_nm    e_val    e_seq
  1       104    test    100      4
  1       102    test2   x        2
  1       102    test2   (null)   1
  1       104    test    (null)   1
  
  2       102    test2   (null)   2
  2       102    test2   (null)   1
  2       104    test    101      1
  2       104    test    102      2
  </code></pre>
  
  <p>I need to first sort by <code>e_id</code>, <code>e_seq</code> for each u_a_id and identify each <code>(null)</code> as 1 and then create a bitmap as below.</p>
  
  <p>For ex. </p>
  
  <ul>
  <li>u_a_id = 1 - first e_id = 102, e_seq = 1, e_val = (null), so assign it 1</li>
  <li>u_a_id = 1 - first e_id = 102, e_seq = 2, e_val = x, so assign it 0</li>
  <li>u_a_id = 1 - first e_id = 104, e_seq = 1, e_val = (null), so assign it 1</li>
  <li>u_a_id = 1 - first e_id = 104, e_seq = 4, e_val = 100, so assign it 0</li>
  </ul>
  
  <p>So, for u_a_id = 1, add a new row - EMPTY = 1010</p>
  
  <p>The output would be:</p>
  
  <pre><code>u_a_id  e_id   e_nm    e_val    e_seq
  1       104    test    100      4
  1       102    test2   x        2
  1       102    test2   (null)   1
  1       104    test    (null)   1
  1       (null) EMPTY   1010     (null)
  
  2       102    test2   (null)   2
  2       102    test2   (null)   1
  2       104    test    101      1
  2       104    test    102      2
  2       (null) EMPTY   1100     (null)
  </code></pre>
  
  <p>Is there a way in Oracle SQL to do it?</p>