回答編集履歴

3

修正

2020/10/12 07:58

投稿

sazi
sazi

スコア25329

test CHANGED
@@ -14,7 +14,15 @@
14
14
 
15
15
  from (
16
16
 
17
+ select *
18
+
19
+ , greatest(
20
+
21
+ main_rank
22
+
17
- select *, main_rank * 10 + sub_rank as rank
23
+ , case when main_rank>=2 and sub_rank>=2 then 3 else sub_rank end
24
+
25
+ ) Rank
18
26
 
19
27
  from (
20
28
 

2

修正

2020/10/12 07:58

投稿

sazi
sazi

スコア25329

test CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  from (
16
16
 
17
- select *, greatest(main_rank, sub_rank) as rank
17
+ select *, main_rank * 10 + sub_rank as rank
18
18
 
19
19
  from (
20
20
 

1

推敲

2020/10/12 01:00

投稿

sazi
sazi

スコア25329

test CHANGED
@@ -112,4 +112,6 @@
112
112
 
113
113
  group by id
114
114
 
115
+ order by id
116
+
115
117
  ```