我需要在 DB2(9.1 版)中两次获取序列的下一个值。而不是执行以下两次:
SELECT nextval FOR schema.sequence AS id
FROM dual
我想做类似的事情:
SELECT nextval FOR schema.sequence AS id1,
nextval FOR schema.sequence AS id2
FROM dual
除了上面只增加一次:
ID1 ID2
----------- -----------
643 643
1 record(s) selected.
我是被迫只查询两次,还是有办法在一次查询中将其增加两次?