0
我试图生成唯一的ID为在DB2使用下列本来做了一个表格:蜂巢生成ID
insert into database.table
select next value for database.sequence,
current_timestamp,
from source
当序列具有确定的初始值(如25430)。
我目前使用的代码是:
insert into database.table
select
row_number() over() + select max(id) from table,
from_unixtime(unix_timestamp())
from source;
这是从嵌套的select语句不工作除了罚款,此刻我要运行
select max(id) from table
,放入手动查询。
任何人都可以提出一种方法来做到这一点在一个查询?
工作很好,谢谢。 –