How to get next 12 months, input may be like SEP-2022
Loading
How to get next 12 months, input may be like SEP-2022
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajanikant HawaldarPosted Sep 27, 2022, 6:15 AM
Uday DodiyaPosted Sep 27, 2022, 7:43 AM
From Current Month To 12 Month
Output
From Jan - 2022 to Dec - 2022
Output
Amit MohantyPosted Sep 27, 2022, 4:32 AM
Try this
SELECT to_char(generate_series('2022-01-01'::timestamp, '2022-12-01', '1 month'), 'Mon-YYYY') AS "Mon-YYYY"