insert into A select first 10 * from B order by rowC
写了一个sql:insert into A select first 10 * from (select * from D where rowD < somevalue order by rowD2)
两张表的列是一样的.
他说不支持,然后改成:
select * from D where rowD < somevalue order by rowD2 INTO temp SMS_TMP
select first 10 * from SMS_TMP INTO SMS_TMP2...
结果他又说,在这句话里面first是不支持的...
那请问,怎么样才能实现我需要的功能呢?(从D表中取出符合某个条件1,然后按照条件2排序的前N条的数据,插入A表中)
THX
[解决办法]
使用UNLOAD TO
unload to SMS_TMP.txt select * from select * from A where rowD < somevalue order by rowD2;
load from SMS_TMP.txt insert into B;
[解决办法]
没办法,只有借助其他字段. 比如时间字段. 不大的话,就一条一条的插乐.
当然也可以用load和unload,但也要手动删除一些数据.