title: How can I select records from the last value accumulated
body: <p>I have the next data: TABLE_A</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>RegisteredDate</th>
  <th>Quantity</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>2022-03-01 13:00</td>
  <td>100</td>
  </tr>
  <tr>
  <td>2022-03-01 13:10</td>
  <td>20</td>
  </tr>
  <tr>
  <td>2022-03-01 13:20</td>
  <td>-80</td>
  </tr>
  <tr>
  <td>2022-03-01 13:30</td>
  <td>-40</td>
  </tr>
  <tr>
  <td>2022-03-02 09:00</td>
  <td>10</td>
  </tr>
  <tr>
  <td>2022-03-02 22:00</td>
  <td>-5</td>
  </tr>
  <tr>
  <td>2022-03-03 02:00</td>
  <td>-5</td>
  </tr>
  <tr>
  <td>2022-03-03 03:00</td>
  <td>25</td>
  </tr>
  <tr>
  <td>2022-03-03 03:20</td>
  <td>-10</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>If I add cumulative column</p>
  <pre><code>select RegisteredDate, Quantity
      , sum(Quantity) over ( order by RegisteredDate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as Summary
  from TABLE_A
  </code></pre>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>RegisteredDate</th>
  <th>Quantity</th>
  <th>Summary</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>2022-03-01 13:00</td>
  <td>100</td>
  <td>100</td>
  </tr>
  <tr>
  <td>2022-03-01 13:10</td>
  <td>20</td>
  <td>120</td>
  </tr>
  <tr>
  <td>2022-03-01 13:20</td>
  <td>-80</td>
  <td>40</td>
  </tr>
  <tr>
  <td>2022-03-01 13:30</td>
  <td>-40</td>
  <td><strong>0</strong></td>
  </tr>
  <tr>
  <td>2022-03-02 09:00</td>
  <td>10</td>
  <td>10</td>
  </tr>
  <tr>
  <td>2022-03-02 22:00</td>
  <td>-5</td>
  <td>5</td>
  </tr>
  <tr>
  <td>2022-03-03 02:00</td>
  <td>-5</td>
  <td><strong>0</strong></td>
  </tr>
  <tr>
  <td>2022-03-03 03:00</td>
  <td>25</td>
  <td>25</td>
  </tr>
  <tr>
  <td>2022-03-03 03:20</td>
  <td>-10</td>
  <td>15</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Is there a way to get the following result with a query?</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>RegisteredDate</th>
  <th>Quantity</th>
  <th>Summary</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>2022-03-03 03:00</td>
  <td>25</td>
  <td>25</td>
  </tr>
  <tr>
  <td>2022-03-03 03:20</td>
  <td>-10</td>
  <td>15</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>This result is the last records after the last zero.</p>
  <p>EDIT:</p>
  <p>Really for the solution to this problem I need the: 2022-03-03 03:00 is the first date of the last records after the last zero.</p>
  <p><a href="https://i.stack.imgur.com/Kc1ij.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kc1ij.png" alt="The expected result" /></a></p>