我试图按日期订购一个表“main_table”(这是一个浮点数),我的初始表看起来像这样(select date from main_table
):
date
20160424105948
20160424045955
20160424050000
20160418170003
20160419233154
20160419233155
所以通过按“按日期排序”创建另一个带有排序行的表,我会得到一些未正确排序的行:
create temp table tmp (like main_table including defaults);
insert into tmp (select * from compact_table order by date asc)
我得到(select date from tmp
):
date
20160418170908
20160418170909
20160418170910
20160420110031 <<
20160418170911
'date'是主键,我的表中有多达600000行,我做错了什么?