Skip to content

Instantly share code, notes, and snippets.

@chbatey
Created September 14, 2015 07:54
Show Gist options
  • Save chbatey/f9b3e41a071205000c39 to your computer and use it in GitHub Desktop.
Save chbatey/f9b3e41a071205000c39 to your computer and use it in GitHub Desktop.
CREATE MATERIALIZED VIEW state_yearly_rain AS
SELECT country_code FROM raw_weather_data WHERE
state_code IS NOT NULL AND
one_hour_precip IS NOT NULL AND
year IS NOT NULL AND
day IS NOT NULL AND
month IS NOT NULL AND
hour IS NOT NULL
PRIMARY KEY ((state_code, year), one_hour_precip, wsid, day, month, hour);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment