Fix sql query for fetching report result counts

This commit is contained in:
Keir Nellyer 2016-06-09 22:48:18 +01:00
parent e24d67ecd3
commit ad17c620b7

View File

@ -24,10 +24,10 @@ public class ReportProfileRepository extends MinecraftRepository
// todo test this query
// todo optimize this query so it only needs run once per fetch
private static final String GRAB_RESULT_COUNT = "SELECT COUNT(*) AS count " +
" FROM reports, reportResults results, reportResults results " +
" FROM reports, reportReasons reasons, reportResults results " +
" WHERE results.reportId = reports.id " +
" AND results.reportId = reports.id" +
" AND results.reporterId = ?" +
" AND reasons.reporterId = ?" +
" AND reports.categoryId = ?" +
" AND results.resultId = ?;";