回答編集履歴

1

追記

2021/11/26 11:42

投稿

takanaweb5
takanaweb5

スコア359

test CHANGED
@@ -10,6 +10,44 @@
10
10
 
11
11
  end
12
12
 
13
+ ```
13
14
 
14
15
 
16
+
17
+ 追記
18
+
19
+ こういうことでしょうか?
20
+
21
+ ```sql
22
+
23
+ select * from users
24
+
25
+ order by case when age < 20 then 1 else 2 end,
26
+
27
+ case when age < 20 then -age else age end;
28
+
29
+
30
+
31
+ select * from users
32
+
33
+ order by case when age < 20 then 1 else 2 end,
34
+
35
+ case when age < 20 then age else age end;
36
+
37
+
38
+
39
+ select * from users
40
+
41
+ order by case when age < 20 then 1 else 2 end,
42
+
43
+ case when age < 20 then age else -age end;
44
+
45
+
46
+
47
+ select * from users
48
+
49
+ order by case when age < 20 then 1 else 2 end,
50
+
51
+ case when age < 20 then -age else -age end;
52
+
15
53
  ```