I want to generate date data using postgresql function "generate_series" , however I have only advanced as far as the following:
SELECT
( DATE_TRUNC( 'month', ld ) + '1 month'::INTERVAL - '1day'::INTERVAL )::DATE AS pe_produc
FROM
GENERATE_SERIES( TIMESTAMP'2022-01-31', TIMESTAMP'2022-3-31', INTERVAL'1 month' ) AS ld
The result of the previous query:
While the date structure I want to generate is as follows:
How should I modify my query to get the desired result?
Thanks in advance.

