title: Replace null value with previous value without using ID in SQL Server 2008
body: <p>It's done with the use of ID but I want without using ID   </p>
  
  <pre><code> SELECT
          ID
          ,COALESCE(p.number, 
              (SELECT TOP (1) number 
              FROM tablea AS p2 
              WHERE
                  p2.number IS NOT NULL 
                  AND p2.ID &lt;= p.ID ORDER BY p2.ID DESC))as Number--,Result = p.number
      FROM TableA AS p;
  </code></pre>
  
  <hr>
  
  <pre><code>ID  number
  1   100
  2   150
  3   NULL
  4   300
  5   NULL
  6   NULL
  7   450
  8   NULL
  9   NULL
  10  560
  11  NULL
  12  880
  13  NULL
  14  579
  15  987
  16  NULL
  17  NULL
  18  NULL
  </code></pre>