Skip to content

Instantly share code, notes, and snippets.

@hostelix
Last active September 7, 2018 16:08
Show Gist options
  • Select an option

  • Save hostelix/d8cd7ac794ce8047acc91d5bd9019801 to your computer and use it in GitHub Desktop.

Select an option

Save hostelix/d8cd7ac794ce8047acc91d5bd9019801 to your computer and use it in GitHub Desktop.
with table_dates AS (
SELECT generate_series(CURRENT_DATE,
(date_trunc('MONTH', CURRENT_DATE) + INTERVAL '1 MONTH - 1 day')::DATE,
'1 day'::interval)::date AS date_day
) SELECT * FROM table_dates WHERE EXTRACT(ISODOW FROM tabla_dias.fecha) IN (6, 7);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment