Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 092c69d

Browse files
committed
improve the query
1 parent 0ab234a commit 092c69d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

queries/check_user_challenge_accessibility

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ SELECT
33
1
44
FROM contest_eligibility ce
55
INNER JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id
6-
INNER JOIN user_group_xref ugx ON ugx.group_id = gce.group_id
6+
LEFT JOIN user_group_xref ugx ON ugx.group_id = gce.group_id
77
WHERE ce.contest_id = @challengeId@
8-
AND ugx.login_id = @user_id@) AS has_access
8+
AND ((ugx.login_id = @user_id@ AND gce.group_id < 2000000) OR gce.group_id >= 2000000)) AS has_access
99
, (SELECT
1010
1
1111
FROM contest_eligibility ce

0 commit comments

Comments
 (0)