Skip to content

1783. Grand Slam Titles 👍

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
SELECT
  Players.player_id,
  Players.player_name,
  SUM(Players.player_id = Championships.Wimbledon) + SUM(Players.player_id = Championships.Fr_open) + SUM(Players.player_id = Championships.US_open) + SUM(Players.player_id = Championships.Au_open) AS grand_slams_count
FROM Players
INNER JOIN Championships
  ON (
    Players.player_id IN (
      Championships.Wimbledon,
      Championships.Fr_open,
      Championships.US_open,
      Championships.Au_open
    )
  )
GROUP BY 1;