我想知道postgres是如何对下列列表进行排序的
15:12:09apple
我在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"2021-10-18 11:12:15堆栈“
"2021-10-18 12:10:09男孩“
2021-10-18 15:12:09苹果
这是怎么回事?
发布于 2021-10-18 12:30:29
正如预期的,它将数据排序为字符串(从最左边的字符开始)
所以2021-10-18 11:12:15stack < 2021-10-18 12:10:09boy < 2021-10-18 15:12:09apple
因为,除了常见的2021-10-18之外,11:12作为字符串是< 12:10作为字符串,15:12是字符串
https://stackoverflow.com/questions/69615611
复制相似问题