i have this view has been update every single day and i want to add a new column called [Flag] to indicate whether if the record is new or existing record,(new is 1,old is 0) for eg: the order is from top to bottom, started from 01/01/2020
old view:
| ID | Date |
|---|---|
| 1 | 01/01/2020 |
| 2 | 01/01/2020 |
| 3 | 01/02/2020 |
| 1 | 01/02/2020 |
| 2 | 01/03/2020 |
new view:
| ID | Flag | Date |
|---|---|---|
| 1 | 1 | 01/01/2020 |
| 2 | 1 | 01/01/2020 |
| 3 | 1 | 01/02/2020 |
| 1 | 0 | 01/02/2020 |
| 2 | 0 | 01/03/2020 |
| 4 | 1 | 01/03/2020 |
I tried to use self-join but the result does not showing correctly, So, im wandering how should i do this? Much Appreciated!!!