This file contains hidden or 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
DECLARE @forecast_snapshot_id uniqueidentifier = '54266D12-8B13-4C23-9BDF-A740580ECFB2'; | |
WITH _sources AS | |
( | |
SELECT | |
CASE | |
WHEN source LIKE 'MB[QL]%' | |
THEN LEFT(source, 7) | |
ELSE LEFT(source, 9) | |
END AS label |
This file contains hidden or 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
USE usga_apps; | |
GO | |
TRUNCATE TABLE seer.forecasts; | |
GO | |
INSERT INTO seer.forecasts | |
SELECT * | |
FROM USGAPROD2.usga_apps.seer.forecasts f | |
WHERE EXISTS |
This file contains hidden or 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
sort -uf \ | |
<(cut -d'|' -f2 growers_20150608.txt) \ | |
<(cut -d'|' -f3 growers_20150608.txt) \ | |
>! names.txt |
This file contains hidden or 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
name: Example Strategy | |
strategy: base_acre | |
geography: &geography | |
include: | |
states: | |
AR: all_counties | |
LA: all_counties | |
MS: all_counties |
This file contains hidden or 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
WITH _data AS | |
( | |
SELECT | |
* | |
,EXTRACT(YEAR FROM invoice_date + INTERVAL '3 MONTHS') AS season | |
FROM public.dcp_sales_log | |
) | |
,_new AS | |
( | |
SELECT |
This file contains hidden or 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
--# :down | |
DROP FUNCTION IF EXISTS jsonb_object_to_property_bag(jsonb, text, text) | |
; | |
--# | |
--# :up | |
CREATE FUNCTION jsonb_object_to_property_bag(jsonb, text = 'key', text = 'value') |
OlderNewer