Skip to content

Commit f9decd1

Browse files
committed
Fix SQL aggregation
1 parent ce44239 commit f9decd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/persistence/terminated_job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func GetLastNJobs(count int) ([]*TerminatedJob, error) {
7575
func GetValidatedChallengePerUser() (map[string][]*TerminatedJob, error) {
7676
res := make(map[string][]*TerminatedJob)
7777

78-
rows, err := DB.Query("SELECT uuid, challenge, username, status, datetime(MIN(created)) FROM job GROUP BY challenge, username HAVING status = 3")
78+
rows, err := DB.Query("SELECT uuid, challenge, username, status, datetime(MIN(created)) FROM job WHERE status=3 GROUP BY challenge, username")
7979
if err != nil {
8080
return nil, err
8181
}

0 commit comments

Comments
 (0)