meilleur score uniquement
This commit is contained in:
@@ -137,10 +137,11 @@ public class GestionnaireBDD {
|
||||
}
|
||||
|
||||
public Object[][] getLeaderboardData() {
|
||||
String sql = "SELECT u.identifiant, p.score, p.date_partie, p.campagne_id, p.difficulte_id " +
|
||||
String sql = "SELECT u.identifiant, MAX(p.score) AS score, p.date_partie, p.campagne_id, p.difficulte_id " +
|
||||
"FROM parties p " +
|
||||
"JOIN utilisateurs u ON p.utilisateur_id = u.id " +
|
||||
"ORDER BY p.score DESC LIMIT 10";
|
||||
"GROUP BY p.campagne_id, p.difficulte_id " +
|
||||
"ORDER BY p.campagne_id ASC, p.difficulte_id ASC";
|
||||
List<Object[]> data = new ArrayList<>();
|
||||
try (Statement stmt = conn.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(sql)) {
|
||||
|
||||
Reference in New Issue
Block a user