New answers tagged

1

One way is to use generate_series() to get a set of all days of the month and then filter it with a WHERE clause checking the weekday for every day. SELECT count(*) FROM generate_series(date_trunc('month', now()), date_trunc('month', now()) + '1 month'::interval - '1 day'::interval, ...


Top 50 recent answers are included