Assume this is my table:

```
ID  NUMBER  DATE
------------------------
1   45      2018-01-01
2   45      2018-01-02
2   45      2018-01-27

```

I need to separate using partition by and row\_number where the difference between one date and another is greater than 5 days. Something like this would be the result of the above example:

```
ROWNUMBER   ID  NUMBER  DATE
-----------------------------
1           1   45      2018-01-01
2           2   45      2018-01-02
1           3   45      2018-01-27

```

My actual query is something like this:

`SELECT ROW_NUMBER() OVER(PARTITION BY NUMBER ODER BY ID DESC) AS ROWNUMBER, ...`

But as you can notice, it doesn't work for the dates. How can I achieve that?