Skip to content

Instantly share code, notes, and snippets.

@fvanderbiest
Created October 11, 2017 08:19
Show Gist options
  • Save fvanderbiest/88466f2bdfd50e3ffed310c6cece106f to your computer and use it in GitHub Desktop.
Save fvanderbiest/88466f2bdfd50e3ffed310c6cece106f to your computer and use it in GitHub Desktop.
migration ogcstatistics
INSERT INTO ogcstatistics.ogc_services_log SELECT * FROM ogcstatistics.ogc_services_log_old where now() - '4 years'::interval > date and date > now() - '5 years'::interval;
INSERT INTO ogcstatistics.ogc_services_log SELECT * FROM ogcstatistics.ogc_services_log_old where now() - '3 years'::interval > date and date > now() - '4 years'::interval;
INSERT INTO ogcstatistics.ogc_services_log SELECT * FROM ogcstatistics.ogc_services_log_old where now() - '2 years'::interval > date and date > now() - '3 years'::interval;
INSERT INTO ogcstatistics.ogc_services_log SELECT * FROM ogcstatistics.ogc_services_log_old where now() - '1 years'::interval > date and date > now() - '2 years'::interval;
INSERT INTO ogcstatistics.ogc_services_log SELECT * FROM ogcstatistics.ogc_services_log_old where date > now() - '1 years'::interval;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment