我不知道怎么做这个查询SQL

时间:2016-06-09 05:27:25

标签: mysql sql

我有下表

Table SQL

我需要获得以下结果,例如:

  

Usuario:4 - idRonda:2 - puntaje:80 - idRonda:3 - puntaje:85。(1   每个用户的行数)

而不是这个:

  

用户:4 - idRonda:2 - puntaje:80

     

用户4: - idROnda:3 - puntaje:85

感谢您的帮助

2 个答案:

答案 0 :(得分:0)

试试这个:

 Select t.idUsuario ,t.idRonda,t.punjtae,s.idRonda,s.punjtae 
from mytable s INNER JOIN mytable t
ON s.idUsuario = t.idUsuario;

答案 1 :(得分:0)

试试这个:

SELECT idUsuario, GROUP_CONCAT(idRonda) AS 'idRonda', GROUP_CONCAT(punjtae) AS 'punjtae'
FROM your_table
GROUP BY idUsuario
相关问题