Mysql
 sql >> Database >  >> RDS >> Mysql

come creare questa query

Usa:

  SELECT p.playername,
         SUM(CASE WHEN g.result = 'first' THEN 1 ELSE 0 END),
         COUNT(*)
    FROM PLAYER p
    JOIN GAME g ON g.playerid = p.playerid
GROUP BY p.playername