我需要爲每個用戶返回遊戲的'flashcards'的所有行。SQL:我只得到一行返回每個用戶
目前我只收到每行用戶返回的一行。
SELECT
s.name as Escuela,
sc.class_description as Clase,
u.level as "Nivel Del Alumno",
CONCAT(u.firstname," ",u.lastname) as Nombre,
stats.game_type as "Tipo de Juego",
MIN(stats.time) as "Tiempo en Segundos",
SEC_TO_TIME(stats.time) as "Tiempo en Formato"
FROM
game_statistics stats
INNER JOIN
users1 u ON stats.user_id = u.id
INNER JOIN
school_classes sc ON u.class_id = sc.id
INNER JOIN
schools s ON s.id = sc.school_id
WHERE
stats.game_type LIKE 'flashcards'
GROUP BY
s.name, sc.class_description,
u.level, Nombre, stats.game_type
ORDER BY
s.name, sc.class_description,
u.level, stats.game_type, stats.time
您正在使用哪個dbms。 (該查詢有點無效...) – jarlh