title: how to assign a rank for null values with previous first non-null value in oracle
body: <p>I need to assign a rank to some null values over ordered rows.<br>
  My query is like this :  </p>
  
  <pre><code>with sub as 
  (
   select 10 as id, 1 as inx,2 as num from dual
    union all
   select 10 as id, 2 as inx,null as num from dual
    union all
   select 10 as id, 3 as inx,8 as num from dual
    union all
   select 10 as id, 4 as inx,null as num from dual
  )
  select *
    from sub order by inx
  </code></pre>
  
  <p>and result set is like this :</p>
  
  <pre><code>id  inx  num
  ---------- 
  10  1    2
  10  2    null
  10  3    8
  10  4    null
  </code></pre>
  
  <p>i'm tring to set null values with previous first non-null value<br>
  for example : num null value should be "2" where inx = 2<br>
  and num null value should be "8" where inx = 4 and so on.  </p>
  
  <p>thx for any idea..</p>