Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @NamedQuery(
- name = "getScoresForTeamThisWeek",
- query = "select sum(query.points) as points, query.name, query.id from "
- +"(select sum(s.value) as points, t.name, t.id "
- +"from Score s join Users u "
- +"on u.id = s.users_id join "
- +"Team_Users tu on tu.users_id = u.id join "
- +"Team t on t.id = tu.team_id "
- +"where s.date between :startDate and :endDate "
- +"and t.id = :teamId "
- +"group by t.name) as query "
- +"group by query.name "
- +"order by points desc"
- )
Add Comment
Please, Sign In to add comment