diff --git a/pom.xml b/pom.xml
index 40ef0ce5..b13f3786 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
ch.seidel
KuTu
- 2.3.12
+ 2.3.13
2014
diff --git a/src/main/scala/ch/seidel/kutu/domain/DisziplinService.scala b/src/main/scala/ch/seidel/kutu/domain/DisziplinService.scala
index c4d97a48..37f53f34 100644
--- a/src/main/scala/ch/seidel/kutu/domain/DisziplinService.scala
+++ b/src/main/scala/ch/seidel/kutu/domain/DisziplinService.scala
@@ -38,13 +38,10 @@ abstract trait DisziplinService extends DBService with WettkampfResultMapper {
and r.durchgang in (#${durchgang.mkString("'", "','", "'")})
)
inner join wettkampf wk on (wk.id = r.wettkampf_id)
- left outer join wertung w on (
- w.wettkampf_id = r.wettkampf_id
- and (w.riege = r.name or w.riege2 = r.name)
- )
where
r.wettkampf_id = $wettkampf
- and w.id is null
+ and (not exists(select 1 from wertung w where w.wettkampf_id = r.wettkampf_id and (w.riege2 <> ''))
+ or not exists(select 1 from wertung w where w.wettkampf_id = r.wettkampf_id and (w.riege = r.name or w.riege2 = r.name)))
order by
4 --wd.ord
""".as[(Long, String, String, Int)]