Agregace souhrnů za období – seskupení, součet počtů, výběr maximální data (zobrazuje se poslední pokus z dané IP pro daný cíl)
1.1 --- a/java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/dao/SouhrnDAO.sql.xml Sat Feb 14 20:17:33 2009 +0100
1.2 +++ b/java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/dao/SouhrnDAO.sql.xml Sat Feb 14 21:04:30 2009 +0100
1.3 @@ -3,21 +3,41 @@
1.4 <properties>
1.5 <entry key="DENNI_SOUHRN">
1.6 <![CDATA[
1.7 - SELECT *
1.8 - FROM souhrn
1.9 - JOIN cil ON (cil.id = souhrn.cil)
1.10 + SELECT max(den) AS den,
1.11 + ip,
1.12 + domena,
1.13 + sum(pocet) AS pocet,
1.14 + cil,
1.15 + id,
1.16 + nazev,
1.17 + url,
1.18 + selekt,
1.19 + databaze
1.20 + FROM souhrn
1.21 + JOIN cil ON (cil.id = souhrn.cil)
1.22 WHERE den >= date_trunc('day', ?::date)
1.23 AND den <= date_trunc('day', ?::date)
1.24 + GROUP BY ip, domena, cil, id, nazev, url, selekt, databaze
1.25 ]]>
1.26 </entry>
1.27 <entry key="DENNI_SOUHRN_CIL">
1.28 <![CDATA[
1.29 - SELECT *
1.30 - FROM souhrn
1.31 - JOIN cil ON (cil.id = souhrn.cil)
1.32 + SELECT max(den) AS den,
1.33 + ip,
1.34 + domena,
1.35 + sum(pocet) AS pocet,
1.36 + cil,
1.37 + id,
1.38 + nazev,
1.39 + url,
1.40 + selekt,
1.41 + databaze
1.42 + FROM souhrn
1.43 + JOIN cil ON (cil.id = souhrn.cil)
1.44 WHERE den >= date_trunc('day', ?::date)
1.45 AND den <= date_trunc('day', ?::date)
1.46 AND cil = ?
1.47 + GROUP BY ip, domena, cil, id, nazev, url, selekt, databaze
1.48 ]]>
1.49 </entry>
1.50 </properties>
1.51 \ No newline at end of file