Skip to content

Instantly share code, notes, and snippets.

@githoov
Created September 16, 2014 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save githoov/942cc3addc82813790ed to your computer and use it in GitHub Desktop.
Save githoov/942cc3addc82813790ed to your computer and use it in GitHub Desktop.
date_series_mysl
- view: day_sequence
derived_table:
sql: |
SELECT DATE(DATE_ADD('2010-01-01', INTERVAL @i := @i + 1 day)) AS series
FROM orders, (SELECT @i := 0) AS i_table
WHERE @i < DATEDIFF(CURDATE(), '2010-01-01') + 1
sql_trigger_value: SELECT CURDATE()
indexes: [series]
fields:
- dimension: series
type: date
sql: ${TABLE}.series
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment