日期:2014-05-16 浏览次数:20534 次
CREATE SEQUENCE "MySchema"."MySeq" AS INTEGER START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE NO CYCLE CACHE 20 NO ORDER
INSERT INTO t_b ( ID, NAME, AGE ) SELECT MySeq.nextVal, NAME, AGE FROM t_a;
INSERT INTO t_b ( ID, NAME, AGE ) VALUES ( MySeq.nextVal,'Lilei',22 ) , ( MySeq.nextVal,'Lucy',18 );
SELECT * FROM ( SELECT ROW_NUMBER() OVER(ORDER BY NAME ASC, AGE DESC) AS row_num, NAME, AGE FROM t_b) t WHERE t.row_num >= 21 AND t.row_num <= 30