skip to Main Content

Postgresql – Generate timestamp series between given dates

Given min and max dates are: Min date: 2023-06-19 09:54:23.000 Max date: now()::timestamp(0)-interval '1 year' Expected output: start_date end_date ------------------------------------------- 2023-12-01 00:00:00.000 2023-12-09 23:59:59.999 2023-11-01 00:00:00.000 2023-11-30 23:59:59.999 2023-10-01 00:00:00.000 2023-10-31 23:59:59.999 2023-09-01 00:00:00.000 2023-09-30 23:59:59.999 2023-08-01 00:00:00.000 2023-08-31 23:59:59.999…

VIEW QUESTION

PostgreSQL Using string_agg with count

I have to create a query to show group_id and the list with subjects and number of people from this group per subject. I have table 'group' with 'entity_type', that can define person's subject and with 'group_type' that defines in…

VIEW QUESTION
Back To Top
Search