Skip to content

Commit 064cdb9

Browse files
committed
dev: updates fy production download view
1 parent 1545061 commit 064cdb9

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
databaseChangeLog:
2+
- changeSet:
3+
id: download-fiscal-year-production-view
4+
author: Jeff Schwartz
5+
runOnChange: true
6+
changes:
7+
- sqlFile:
8+
path: src/views/download_fiscal_year_production.sql
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
DROP VIEW IF EXISTS download_fiscal_year_production;
2+
3+
CREATE VIEW download_fiscal_year_production AS
4+
SELECT DISTINCT period.period_date AS "Date",
5+
period.fiscal_year AS "Fiscal Year",
6+
location.land_class AS "Land Class",
7+
location.land_category AS "Land Category",
8+
location.state_name AS "State",
9+
location.county AS "County",
10+
CASE
11+
WHEN location.county::text <> ''::text THEN location.fips_code
12+
ELSE ''::character varying
13+
END AS "FIPS Code",
14+
location.offshore_region AS "Offshore Region",
15+
commodity.product AS "Product",
16+
production.volume AS "Volume"
17+
FROM production
18+
JOIN period USING (period_id)
19+
JOIN location USING (location_id)
20+
JOIN commodity USING (commodity_id)
21+
WHERE period.period::text = 'Fiscal Year'::text
22+
ORDER BY period.period_date;

0 commit comments

Comments
 (0)