I have the following table, very simple:
| DATE_START | ID |
| 19921101 | 0502010000013950 |
| 19950209 | 0502010000013950 |
| 20031231 | 0502010000013950 |
| 20040115 | 0502010000013950 |
| 20040120 | 0502010000013950 |
| 20110704 | 0502010000013950 |
| 20200211 | 0502010000013950 |
| 20251005 | 0502010000013950 |
I want to make te following result:
| DATE_START | DATE_END | ID |
| 19921101 | 19950209 | 0502010000013950 |
| 19950209 | 20031231 | 0502010000013950 |
| 20031231 | 20040115 | 0502010000013950 |
| 20040115 | 20040120 | 0502010000013950 |
| 20040120 | 20110704 | 0502010000013950 |
| 20110704 | 20200211 | 0502010000013950 |
| 20200211 | 20251005 | 0502010000013950 |
| 20251005 | null | 0502010000013950 |
Date_end is next value of date_start to create a cycles like this. This what i did:


I get to following result:

U see the problem is with the last date_end, he is using for that feature the first date_start. I dont now how.
Anyone a solution?



