View difference between Paste ID: S58rm9cS and tT3DF59W
SHOW: | | - or go back to the newest paste.
1
SELECT COUNT(bet) 
2
from User user
3
join user.bets bet 
4
join bet.match match 
5
join match.competition competition 
6-
where user.id= :userId and competition.id= :competitionId and  bet.value IS EMPTY;
6+
where user.id= :userId and competition.id= :competitionId and  bet.value IS NOT EMPTY;