title: SQL: How to fill empty cells with previous row value on basis of condition?
body: <p><strong>SQL: Fill empty cells with previous row value on basis of condition?</strong></p>
  
  <p>Please treat this as High Priority Request..help needed</p>
  
  <p>Requesting a high rep user link it (<a href="https://i.imgur.com/P4UOiMz.jpg" rel="nofollow noreferrer">http://i.imgur.com/P4UOiMz.jpg</a>)</p>
  
  <p>I need to produce the column "OXY_ID_NEW" in the following table using SQL. Is this possible in SQL 2008R2 or SQL 2012 or Amazon REDSHIFT?</p>
  
  <p>SQL TABLE image(<a href="https://i.imgur.com/P4UOiMz.jpg" rel="nofollow noreferrer">http://i.imgur.com/P4UOiMz.jpg</a>)</p>
  
  <p>Basically, I wanted to forward fill empty "OXY_ID" cells with last known Oxy_id for that ID, as shown in 'OXY_ID_NEW' column.</p>