From 69ac94939e55a867ffe651d6351a4370bdf84e71 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Tue, 4 Jul 2017 16:56:02 +0200 Subject: [PATCH] Fixed aggregation query The interesting value for the sales is the nr of sold articles, NOT the amount of database entries. Signed-off-by: Jim Martens --- 07/src/de/dis2017/data/db/ORM.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/07/src/de/dis2017/data/db/ORM.java b/07/src/de/dis2017/data/db/ORM.java index 5ab9773..9607180 100644 --- a/07/src/de/dis2017/data/db/ORM.java +++ b/07/src/de/dis2017/data/db/ORM.java @@ -197,7 +197,7 @@ public class ORM { // --- analysis part starts here public Map>> getSalesCrossTable(int year) { - String querySQL = "SELECT COUNT(s.ID) AS sales, a.NAME AS article, sh.CITY AS city, d.QUARTER AS quarter " + + String querySQL = "SELECT SUM(s.SOLDUNITS) AS sales, a.NAME AS article, sh.CITY AS city, d.QUARTER AS quarter " + "FROM VSISP12.SALES AS s, " + "VSISP12.DATETABLE AS d, " + "VSISP12.SHOP AS sh, " +