title: Rolling 90 day date window in SQL Oracle
body: <pre class="lang-sql prettyprint-override"><code>SELECT *
    FROM (SELECT date'2021-05-06' AS tran_dt FROM dual UNION
          SELECT date'2021-05-24' FROM dual UNION
          SELECT date'2021-06-25' FROM dual UNION
          SELECT date'2021-07-02' FROM dual UNION
          SELECT date'2021-07-27' FROM dual UNION
          SELECT date'2021-08-16' FROM dual UNION
          SELECT date'2021-08-23' FROM dual UNION
          SELECT date'2021-10-01' FROM dual UNION
          SELECT date'2021-12-31' FROM dual)
  </code></pre>
  <p>Hello</p>
  <p>I am working with a date field in SQL Oracle.</p>
  <p>I am trying to create rolling window that returns the first row and returns another row when the date is &gt;90 since the last returned row.</p>
  <p>In the below example, I want to calculate and return where the Alert field = Yes.</p>
  <p>Grateful if anyone has any ideas.</p>
  <p>Thanks</p>
  <p>Shee7</p>
  <pre><code>TRAN_DT    Alert    Days Since Last Alert
  06/05/2021  Yes     0
  24/05/2021  No      18
  25/06/2021  No      50
  02/07/2021  No      57
  27/07/2021  No      82
  16/08/2021  Yes     102
  23/08/2021  No      7
  01/10/2021  No      46
  31/12/2021  Yes     137
  </code></pre>