回答編集履歴
2
chousei
test
CHANGED
@@ -15,3 +15,13 @@
|
|
15
15
|
select * from tbl order by age<20 desc,age desc
|
16
16
|
|
17
17
|
```
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
※ネタ
|
22
|
+
|
23
|
+
```SQL
|
24
|
+
|
25
|
+
select * from tbl order by (age<20)*999+age desc
|
26
|
+
|
27
|
+
```
|
1
chousei
test
CHANGED
@@ -5,3 +5,13 @@
|
|
5
5
|
select * from tbl order by case when age<20 then 1 else 2 end asc,age desc
|
6
6
|
|
7
7
|
```
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
mysqlならこれでも行けるかもしれません
|
12
|
+
|
13
|
+
```SQL
|
14
|
+
|
15
|
+
select * from tbl order by age<20 desc,age desc
|
16
|
+
|
17
|
+
```
|