1.1 --- a/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/dao/PodnikDAO.sql.xml Sun Jun 20 14:46:47 2010 +0200
1.2 +++ b/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/dao/PodnikDAO.sql.xml Sat Jan 08 21:51:54 2011 +0100
1.3 @@ -3,8 +3,8 @@
1.4 <properties>
1.5 <entry key="HLASOVANI_INSERT">
1.6 INSERT INTO hlasovani
1.7 - (podnik, hlas, ip_adresa)
1.8 - VALUES (:podnik, :hlas, :ip_adresa);
1.9 + (podnik, hlas, ip_adresa)
1.10 + VALUES (:podnik, :hlas, :ip_adresa);
1.11 </entry>
1.12 <entry key="HLASOVANI_SELECT">
1.13 <!--
1.14 @@ -14,10 +14,10 @@
1.15 (může efektivně hlasovat každý den jednou).
1.16 -->
1.17 SELECT hlas,
1.18 - int4(count(*))
1.19 + int4(count(*))
1.20 FROM (
1.21 - SELECT DISTINCT ON (ip_adresa, date(datum))
1.22 - hlas
1.23 + SELECT DISTINCT ON (ip_adresa, date(datum))
1.24 + hlas
1.25 FROM hlasovani
1.26 WHERE podnik = :podnik
1.27 ORDER BY ip_adresa, date(datum), id DESC