我想知道postgres如何排序以下类型的列表
- 2021-10-18 15:12:09apple
- 2021-10-18 12:10:09boy
- 2021-10-18 11:12:15stack
我尝试在postgres中,它导致以下顺序
with temp_table(a) as (
values ('2021-10-18 15:12:09apple'),
('2021-10-18 12:10:09boy'),
('2021-10-18 11:12:15stack')
) select * from temp_table order by a
20121-10-18 11:12:15stack">
20121-10-18 12:10:09boy">
20121-10-18 15:12:09apple">
这是如何工作的?
如预期的那样,它将数据按字符串排序(从最左边的字符开始)
所以2021-10-18 11:12:15stack
<2021-10-18 12:10:09boy
>
因为,除了常见的2021-10-18
,11:12
作为字符串是<12:10
为字符串15:12
为字符串>