]> git.sesse.net Git - ccbs/blobdiff - bigscreen/fetch_top_scores_for_tournament.cpp
Various changes and fixes for CC1.
[ccbs] / bigscreen / fetch_top_scores_for_tournament.cpp
index 9c38f51e6742708c128b430a4442a4451515c1f6..dd70331a87d85c69c1dec418d50c7ea0eb73108d 100644 (file)
@@ -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)) );