I need to create a query to get the consecutive days by the data dates.
Using this table as sample:
id_used | ref_date
---------+---------------------
1 | 2021-02-01 00:00:00
1 | 2021-09-01 00:00:00
1 | 2021-09-02 00:00:00
1 | 2021-09-03 00:00:00
My return should be 3 (The 3 last rows).