X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Ffetch_top_scores_for_tournament.cpp;fp=bigscreen%2Ffetch_top_scores_for_tournament.cpp;h=dd70331a87d85c69c1dec418d50c7ea0eb73108d;hp=9c38f51e6742708c128b430a4442a4451515c1f6;hb=16d44dda496bb6fec27aeea13decaae16fd08f7e;hpb=d4f2692e015be09f0018f645e32f867f62446d22 diff --git a/bigscreen/fetch_top_scores_for_tournament.cpp b/bigscreen/fetch_top_scores_for_tournament.cpp index 9c38f51..dd70331 100644 --- a/bigscreen/fetch_top_scores_for_tournament.cpp +++ b/bigscreen/fetch_top_scores_for_tournament.cpp @@ -19,7 +19,7 @@ void FetchTopScoresForTournament::operator() (pqxx::transaction<> &t) // Again, this will break if a song has more than one short title pqxx::result res( t.exec( - "SELECT nick, title, shorttitle, score FROM scores NATURAL JOIN tournaments NATURAL JOIN players NATURAL JOIN songs NATURAL LEFT JOIN songshorttitles WHERE tournament=" + + "SELECT nick, title, shorttitle, score FROM scores NATURAL JOIN tournaments JOIN players ON scores.player=players.player NATURAL JOIN songs NATURAL LEFT JOIN songshorttitles WHERE tournament=" + pqxx::to_string(tournament) + " AND score IS NOT NULL ORDER BY score DESC LIMIT " + pqxx::to_string(num)) );