By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Records: 6 Duplicates: 0 Warnings: 0
employeeID | grade | effectiveFrom | #Days |
---|---|---|---|
1 | A | 2022-01-01 00:00:00 | 14 |
1 | B | 2022-01-15 00:00:00 | 17 |
2 | A | 2022-01-01 00:00:00 | 31 |
3 | A | 2022-01-01 00:00:00 | 14 |
3 | B | 2022-01-15 00:00:00 | 10 |
3 | A | 2022-01-25 00:00:00 | 7 |
employeeID | grade | SUM(`#Days`) |
---|---|---|
1 | A | 14 |
1 | B | 17 |
2 | A | 31 |
3 | A | 21 |
3 | B | 10 |
CurrentDate | LastDayOfCurrentMonth |
---|---|
2022-10-01 | 2022-10-31 |