Skip to content

Commit

Permalink
Fix SQL aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lesterpig committed Nov 28, 2016
1 parent ce44239 commit f9decd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/persistence/terminated_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func GetLastNJobs(count int) ([]*TerminatedJob, error) {
func GetValidatedChallengePerUser() (map[string][]*TerminatedJob, error) {
res := make(map[string][]*TerminatedJob)

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

0 comments on commit f9decd1

Please sign in to comment.