sales_walk/sql/budget.sql

22 lines
400 B
MySQL
Raw Normal View History

2023-10-16 16:44:36 -04:00
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