回答編集履歴

2

推敲

2021/04/22 06:28

投稿

sazi
sazi

スコア25327

test CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  on evaluations.soccer_player_id=players.id
16
16
 
17
- group by soccer_player_id
17
+ group by soccer_player_id, email
18
18
 
19
19
  ) edit
20
20
 

1

推敲

2021/04/22 06:28

投稿

sazi
sazi

スコア25327

test CHANGED
@@ -2,28 +2,22 @@
2
2
 
3
3
  ```SQL
4
4
 
5
- select step2.* , players.email
5
+ select *
6
6
 
7
- from (
7
+ from (
8
8
 
9
- select *
9
+ select soccer_player_id, email, avg(evaluation) avg_evaluation
10
10
 
11
- from (
11
+ from evaluations
12
12
 
13
- select soccer_player_id, avg(evaluation) avg_evaluation
13
+ inner join players
14
14
 
15
- from evaluations
15
+ on evaluations.soccer_player_id=players.id
16
16
 
17
- group by soccer_player_id
17
+ group by soccer_player_id
18
18
 
19
- ) step1
19
+ ) edit
20
20
 
21
- order by avg_evaluation desc limit 3
21
+ order by avg_evaluation desc limit 3
22
-
23
- ) step2
24
-
25
- inner join players
26
-
27
- on step2.soccer_player_id=players.id
28
22
 
29
23
  ```