By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| version |
|---|
| PostgreSQL 14.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20), 64-bit |
SELECT 1
CREATE TABLE
INSERT 0 7
| start_tz | end_tz | ms | sensor_id |
|---|---|---|---|
| 2022-01-01 00:00:00+00 | 2022-01-01 00:20:00+00 | stationary | 42 |
| 2022-01-01 00:20:00+00 | 2022-01-01 00:40:00+00 | stationary | 42 |
| 2022-01-01 00:40:00+00 | 2022-01-01 01:00:00+00 | in_motion) | 42 |
| 2022-01-01 01:00:00+00 | 2022-01-01 01:20:00+00 | stationary | 42 |
| 2022-01-01 01:20:00+00 | 2022-01-01 01:40:00+00 | stationary | 42 |
SELECT 5