-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE OR REPLACE VIEW king_pilot.pilot_weeks AS | ||
SELECT week, row_number() OVER() as week_number | ||
FROM (SELECT DISTINCT ON(date_trunc('week', dt)::DATE) date_trunc('week', dt)::DATE as week | ||
FROM king_pilot.dash_daily_dev | ||
WHERE dt >= '2017-11-13' )a | ||
ORDER BY week; | ||
|
||
CREATE OR REPLACE VIEW king_pilot.pilot_months AS | ||
SELECT month, row_number() OVER() as month_number | ||
FROM (SELECT DISTINCT ON(date_trunc('month', dt)::DATE) date_trunc('month', dt)::DATE as month | ||
FROM king_pilot.dash_daily | ||
WHERE dt >= '2017-11-13' )a | ||
ORDER BY month; |