- pqxx::result res( t.exec("SELECT song,MAX(feetrating)*1000 AS max_score FROM songratings WHERE "
- " machine=( SELECT machine FROM tournaments WHERE tournament=" + pqxx::to_string(tournament) + ") AND playmode='single' GROUP BY song") );
-
+ pqxx::result res( t.exec("SELECT * FROM get_max_score_for_songs("
+ + pqxx::to_string(tournament) + ", 'single')") );
+
for (pqxx::result::const_iterator i = res.begin(); i != res.end(); ++i) {
unsigned song, max_score;
song = i["song"].as(song);
for (pqxx::result::const_iterator i = res.begin(); i != res.end(); ++i) {
unsigned song, max_score;
song = i["song"].as(song);