clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2805483 fiddles created (40789 in the last week).

CREATE FUNCTION genDates(t1 date, t2 date) RETURNS setof date AS $$ WITH dt AS ( SELECT d::date, extract(dow from d) dow FROM generate_series(t1::timestamp, t2::timestamp, '1 day') AS gs(d) ) SELECT d FROM dt WHERE dow <> extract(dow from t1+5) and dow <> extract(dow from t1+6) $$ LANGUAGE sql IMMUTABLE;
 hidden batch(es)


SELECT * FROM genDates('2021-08-29'::date, '2021-09-29'::date)
gendates
2021-08-29
2021-08-30
2021-08-31
2021-09-01
2021-09-02
2021-09-05
2021-09-06
2021-09-07
2021-09-08
2021-09-09
2021-09-12
2021-09-13
2021-09-14
2021-09-15
2021-09-16
2021-09-19
2021-09-20
2021-09-21
2021-09-22
2021-09-23
2021-09-26
2021-09-27
2021-09-28
2021-09-29
 hidden batch(es)