Player score for details
This commit is contained in:
parent
43d498a822
commit
2f9d604ccf
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ public enum DatabaseQuery {
|
||||||
// PLAYERS
|
// PLAYERS
|
||||||
GET_PLAYER_SIMPLE("SELECT pseudo, email, firstname, lastname, description FROM players WHERE id_player = ?"),
|
GET_PLAYER_SIMPLE("SELECT pseudo, email, firstname, lastname, description FROM players WHERE id_player = ?"),
|
||||||
GET_PLAYER_DETAILS(
|
GET_PLAYER_DETAILS(
|
||||||
"SELECT p.*, scores.score, scores.completions, scores.tries, scores.rank, g.* FROM players p, (SELECT fk_player, SUM(c.score) AS score, COUNT(c.id_completion) AS completions, SUM(c.tries) AS tries, rank() over(ORDER BY score DESC) AS rank FROM completions c GROUP BY c.fk_player) AS scores LEFT JOIN containsGroups cg ON scores.fk_player = cg.fk_player LEFT JOIN groups g ON cg.fk_group = g.id_group WHERE p.id_player = scores.fk_player AND "),
|
"SELECT p.*, scores.score, scores.completions, scores.tries, scores.rank, g.* FROM players p, (SELECT fk_player, SUM(c.score) AS score, COUNT(c.id_completion) AS completions, SUM(c.tries) AS tries, rank() over(ORDER BY score DESC) AS rank FROM completions c GROUP BY c.fk_player) AS scores LEFT JOIN containsGroups cg ON scores.fk_player = cg.fk_player LEFT JOIN groups g ON cg.fk_group = g.id_group WHERE p.id_player = scores.fk_player AND c.score > 0 AND "),
|
||||||
GET_PLAYER_DETAILS_BY_ID(GET_PLAYER_DETAILS, " p.id_player = ? ORDER BY g.fk_chapter, g.fk_puzzle;"),
|
GET_PLAYER_DETAILS_BY_ID(GET_PLAYER_DETAILS, " p.id_player = ? ORDER BY g.fk_chapter, g.fk_puzzle;"),
|
||||||
GET_PLAYER_DETAILS_BY_PSEUDO(GET_PLAYER_DETAILS, "p.pseudo = ? ORDER BY g.fk_chapter, g.fk_puzzle;"),
|
GET_PLAYER_DETAILS_BY_PSEUDO(GET_PLAYER_DETAILS, "p.pseudo = ? ORDER BY g.fk_chapter, g.fk_puzzle;"),
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue