I have a table with two columns ID and Date say like with below data. For a given range say like from 2022-09-01 to 2022-09-10 I want to return the missing dates for respective ID's along with ID value, I want data to be returned as mentioned in Expected output. How can I achieve this
Data inside table:
| ID | Date |
|---|---|
| 1 | 2022-09-01 |
| 1 | 2022-09-07 |
| 1 | 2022-09-08 |
| 1 | 2022-09-09 |
| 2 | 2022-09-01 |
| 2 | 2022-09-02 |
| 2 | 2022-09-03 |
| 2 | 2022-09-04 |
Expected Output:
| ID | Missing Dates |
|---|---|
| 1 | 2022-09-02 |
| 1 | 2022-09-03 |
| 1 | 2022-09-04 |
| 1 | 2022-09-05 |
| 1 | 2022-09-06 |
| 1 | 2022-09-10 |
| 2 | 2022-09-05 |
| 2 | 2022-09-06 |
| 2 | 2022-09-07 |
| 2 | 2022-09-08 |
| 2 | 2022-09-09 |
| 2 | 2022-09-10 |