title: Flagging records that meet a specific condition using SQL on a Firebird Database
body: <p>I am currently working with a Firebird database and I am trying to identify/flag records<br>
  that have a zero pos_buildcount value and where the previous record to the zero record   has a pos_buildcount value that is not 255. I can do it in excel but I want to do it in    a SQL query as excel can only deal with a certain amount of records. Essentially I want   my results to look like the following image:</p>
  
  <p><img src="https://i.stack.imgur.com/ttpCb.jpg" alt="Required Results"></p>
  
  <p>I have tried the following links to try select individual records but most solutions use   a id number which my database doesn't have (I don't know why) or the solutions use the   row_number() command which Firebird does not have.  </p>
  
  <p><a href="https://dba.stackexchange.com/questions/146657/selecting-the-last-record-that-meets-a-condition">Selecting the last record that meets a condition</a></p>
  
  <p><a href="https://stackoverflow.com/questions/710212/is-there-a-way-to-access-the-previous-row-value-in-a-select-statement">Is there a way to access the “previous row” value in a SELECT statement?</a></p>