By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| version |
|---|
| PostgreSQL 13.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1), 64-bit |
5 rows affected
| request | location | requestdate | completedate | prev_date | diff |
|---|---|---|---|---|---|
| R-001 | a | 2020-01-01 | 2020-01-05 | null | null |
| R-002 | a | 2020-03-17 | 2020-03-20 | 2020-01-05 | 72 |
| R-005 | a | 2020-07-03 | 2020-07-07 | 2020-03-20 | 105 |
| R-004 | b | 2020-02-27 | 2020-03-01 | null | null |
| R-003 | b | 2020-04-22 | 2020-04-23 | 2020-03-01 | 52 |
5 rows affected
| request | location | requestdate | completedate | prev_date | diff |
|---|---|---|---|---|---|
| R-001 | a | 2020-01-01 | 2020-01-05 | null | null |
| R-002 | a | 2020-03-17 | 2020-03-20 | 2020-01-05 | 72 |
| R-005 | a | 2020-07-03 | 2020-07-07 | 2020-03-20 | 105 |
| R-004 | b | 2020-02-27 | 2020-03-01 | null | null |
| R-003 | b | 2020-04-22 | 2020-04-23 | 2020-03-01 | 52 |