And completion
This commit is contained in:
parent
371035074c
commit
91ded5efdd
1 changed files with 7 additions and 2 deletions
|
@ -43,8 +43,13 @@ public enum DatabaseQuery {
|
|||
// COMPLETIONS
|
||||
GET_COMPLETION(
|
||||
"SELECT id_completion, tries, fileName, score FROM completions WHERE fk_puzzle = ? AND fk_player = ?"),
|
||||
GET_COMPLETION_GROUP(
|
||||
"SELECT c.* FROM containsGroups cg LEFT JOIN groups g ON cg.fk_group = g.id_group LEFT JOIN completions c ON cg.fk_player = c.fk_player WHERE cg.fk_player = ? AND g.fk_puzzle = ? AND c.fk_puzzle = g.fk_puzzle"),
|
||||
GET_COMPLETION_GROUP("SELECT c\r\n"
|
||||
+ "FROM completions c\r\n"
|
||||
+ "JOIN containsGroups cG on c.fk_player = cG.fk_player\r\n"
|
||||
+ "JOIN containsGroups cGs on cGs.fk_group = cG.fk_group\r\n"
|
||||
+ "JOIN groups g on cG.fk_group = g.id_group\r\n"
|
||||
+ "JOIN puzzles p on p.id_puzzle = c.fk_puzzle\r\n"
|
||||
+ "WHERE cGs.fk_player = ? AND p.id_puzzle = ?"),
|
||||
INSERT_COMPLETION(
|
||||
"INSERT INTO completions (fk_puzzle, fk_player, tries, code, fileName, score) values (?, ?, ?, ?, ?, ?)"),
|
||||
UPDATE_COMPLETION(
|
||||
|
|
Loading…
Add table
Reference in a new issue