From bb9b1a6d8a12f4cbbc0dcfff9f1504d71a339b7d Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 16 Oct 2023 16:44:36 -0400 Subject: [PATCH] vault backup: 2023-10-16 16:44:36 --- sql/budget.sql | 21 +++++++++++++++++++++ sql/budgetc.sql | 20 ++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 sql/budget.sql create mode 100644 sql/budgetc.sql diff --git a/sql/budget.sql b/sql/budget.sql new file mode 100644 index 0000000..253fc26 --- /dev/null +++ b/sql/budget.sql @@ -0,0 +1,21 @@ +WITH x AS ( + SELECT + version, + oseas, + customer, + biggroup, + sum(sales_usd), + sum(pounds), + string_agg(distinct mold,', ') + FROM b + left outer join rlarp.molds m ON + m.stlc = b.mold + WHERE + oseas = 2024 + GROUP BY + version, + oseas, + customer, + biggroup +) +SELECT * FROM X diff --git a/sql/budgetc.sql b/sql/budgetc.sql new file mode 100644 index 0000000..10f6e02 --- /dev/null +++ b/sql/budgetc.sql @@ -0,0 +1,20 @@ +WITH x AS ( + SELECT + version, + oseas, + customer, + sum(sales_usd), + sum(pounds) + --string_agg(distinct mold,', ') + FROM b + left outer join rlarp.molds m ON + m.stlc = b.mold + WHERE + oseas = 2024 + AND version = 'Forecats' + GROUP BY + version, + oseas, + customer +) +SELECT * FROM X