I have a series of dates in a result thus (the order is important):
2020-09-24
2020-09-22
2020-09-23
2020-09-21
2020-09-17
2020-09-18
2020-09-16
2020-09-28
2020-09-25
2009-05-13
2008-10-24
2009-05-23
And I need to remove dates where there are not more than 14 days since the last used date, starting with 2020-09-24 so:
2020-09-24
2009-05-13
2008-10-24
Would be the result.
I've been wracking my head trying to work out how to do this but can not work out how to roll the last 'good' value to compare against... Is there a way in sql to do this?