在 informix 中创建自动序列列

0 sql informix

是否可以在 Informix 中按 1,2,3,4... 的顺序创建自动序列索引以及语法是什么。我有一个查询,并且我的一些时间戳是相同的,因此我无法使用时间戳变量进行查询。谢谢!

Car*_*aga 5

这些是我运行的用于将 id 字段添加到现有表的命令。登录到 dbaccess 控制台时。

alter table my_table add id integer before some_field;

create sequence myseq;
update my_table set id = myseq.nextval;
drop sequence myseq;

alter table my_table modify (id serial not null);
Run Code Online (Sandbox Code Playgroud)

感谢@ricardo-henriques 为我指明了正确的方向。这些命令将允许您在数据库上运行他的答案中解释的说明。