2023-12-17 08:11:30 +00:00
|
|
|
-- no modifiers
|
2023-12-17 03:21:46 +00:00
|
|
|
A 2
|
2023-12-16 09:59:50 +00:00
|
|
|
B 3
|
|
|
|
C \N
|
2023-12-17 03:21:46 +00:00
|
|
|
D 1
|
|
|
|
1 D
|
|
|
|
2 A
|
|
|
|
3 B
|
|
|
|
\N C
|
2023-12-17 08:11:30 +00:00
|
|
|
A 2
|
|
|
|
B 3
|
|
|
|
C \N
|
|
|
|
D 1
|
|
|
|
1 D
|
|
|
|
2 A
|
|
|
|
3 B
|
|
|
|
\N C
|
2023-12-19 08:13:17 +00:00
|
|
|
-- with ASC/DESC modifiers
|
2023-12-19 07:18:27 +00:00
|
|
|
A 2
|
|
|
|
B 3
|
|
|
|
C \N
|
|
|
|
D 1
|
2023-12-19 08:13:17 +00:00
|
|
|
D 1
|
|
|
|
C \N
|
|
|
|
B 3
|
|
|
|
A 2
|
2023-12-19 07:18:27 +00:00
|
|
|
A 2
|
|
|
|
B 3
|
|
|
|
C \N
|
|
|
|
D 1
|
|
|
|
D 1
|
|
|
|
C \N
|
|
|
|
B 3
|
|
|
|
A 2
|
|
|
|
-- with NULLS FIRST/LAST modifiers
|
|
|
|
\N C
|
|
|
|
1 D
|
|
|
|
2 A
|
|
|
|
3 B
|
|
|
|
1 D
|
|
|
|
2 A
|
|
|
|
3 B
|
|
|
|
\N C
|
2023-12-19 08:13:17 +00:00
|
|
|
\N C
|
|
|
|
1 D
|
|
|
|
2 A
|
|
|
|
3 B
|
|
|
|
1 D
|
|
|
|
2 A
|
|
|
|
3 B
|
|
|
|
\N C
|
2024-02-21 20:24:32 +00:00
|
|
|
-- SELECT *
|
|
|
|
A 2
|
|
|
|
B 3
|
|
|
|
C \N
|
|
|
|
D 1
|
|
|
|
A 2
|
|
|
|
B 3
|
|
|
|
C \N
|
|
|
|
D 1
|
|
|
|
-- the trouble starts when "order by all is all" is ambiguous
|
|
|
|
-- columns
|
|
|
|
B 3 10
|
|
|
|
D 1 20
|
|
|
|
A 2 30
|
|
|
|
C \N 40
|
|
|
|
B
|
|
|
|
D
|
|
|
|
A
|
|
|
|
C
|
2024-02-21 18:05:20 +00:00
|
|
|
B 3 10
|
|
|
|
D 1 20
|
|
|
|
A 2 30
|
|
|
|
C \N 40
|
|
|
|
B 3 10
|
|
|
|
D 1 20
|
|
|
|
A 2 30
|
|
|
|
C \N 40
|
2024-02-21 20:24:32 +00:00
|
|
|
B
|
|
|
|
D
|
|
|
|
A
|
|
|
|
C
|
|
|
|
B 3 10
|
|
|
|
D 1 20
|
|
|
|
A 2 30
|
|
|
|
C \N 40
|
|
|
|
-- column aliases
|
2024-02-21 18:05:20 +00:00
|
|
|
D 1
|
2024-01-31 22:12:33 +00:00
|
|
|
A 2
|
|
|
|
B 3
|
|
|
|
C \N
|
|
|
|
D 1
|
2024-02-21 18:05:20 +00:00
|
|
|
A 2
|
|
|
|
B 3
|
|
|
|
C \N
|
2024-02-21 20:24:32 +00:00
|
|
|
-- expressions
|
2024-02-21 18:05:20 +00:00
|
|
|
A 2
|
|
|
|
B 3
|
|
|
|
D 1
|
|
|
|
\N
|
|
|
|
A 2
|
|
|
|
B 3
|
|
|
|
D 1
|
|
|
|
\N
|
2024-02-21 20:24:32 +00:00
|
|
|
-- ORDER BY ALL loses its special meaning when used in conjunction with other columns
|
2024-02-21 18:05:20 +00:00
|
|
|
B 3 10
|
|
|
|
D 1 20
|
|
|
|
A 2 30
|
|
|
|
C \N 40
|
|
|
|
B 3 10
|
|
|
|
D 1 20
|
|
|
|
A 2 30
|
|
|
|
C \N 40
|