AppDbUpdater: Extract sql commands as embedded resources

This commit is contained in:
2024-01-05 13:17:29 +01:00
parent ab61edc402
commit f28a1a2db9
13 changed files with 695 additions and 756 deletions

View File

@ -0,0 +1,11 @@
-- schema version 11 to 12
CREATE VIEW v_stat_member AS
SELECT year, mgnr,
SUM(weight) AS sum,
ROUND(SUM(kmw * weight) / SUM(weight), 2) AS kmw,
ROUND(SUM(oe * weight) / SUM(weight), 1) AS oe,
COUNT(DISTINCT did) AS lieferungen
FROM v_delivery
GROUP BY year, mgnr
ORDER BY year, mgnr;