Strange results with generate_series
Posted: Mon Mar 04, 2019 11:23 am
Can someone explain to me why I have different responses when I run the following 2 queries in pgAdmin.
The first will return 13 rows, the second will return 14 rows.
And Servoy gives the same results as pgAdmin, so is there a reason why the last date is only included when the second timestamp is above 11:00?
I have also tested these queries in another query tool (Datagrip from Jetbrains) and there the breakpoint seems to be at 10:00.
SELECT dd FROM generate_series ( '2018-10-01T10:00:00.000Z', '2018-12-31T10:59:59.000Z', '1 week'::interval) dd;
SELECT dd FROM generate_series ( '2018-10-01T10:00:00.000Z', '2018-12-31T11:59:59.000Z', '1 week'::interval) dd;
The first will return 13 rows, the second will return 14 rows.
And Servoy gives the same results as pgAdmin, so is there a reason why the last date is only included when the second timestamp is above 11:00?
I have also tested these queries in another query tool (Datagrip from Jetbrains) and there the breakpoint seems to be at 10:00.