.NI4bb{z[-Vx0
I"e8U4mk/G z01、删除已经存在的myseq序列:
-pN[e7g:G7b0drop sequence myseq;
l6~DU-A3f051Testing软件测试网&[5Vm(O?:f4tX:o创建一个在1--10之间幅度为2的循环序列:51Testing软件测试网!\CrHU\'vC
create sequence myseq51Testing软件测试网R.J_
]+dU2f%r3i
maxvalue 10
3M
? }4OHU n.}
d:Uh0 start with 151Testing软件测试网}aJ'n"}m1};`O
increment by 2
s,BdD)mW0 cache 2
[{XYMQs+@J0 cycle;51Testing软件测试网1~
dG!x#_dp.C'o
6P u-Xs!o)t03、创建测试表:
6Ta`pow0create table testseq(next number,
;l/yg1`B'f%o(P]0 curr number);51Testing软件测试网8l{3L{K-pJ
4、插入测试数据:51Testing软件测试网T
l0R t#\g
insert into testseq(next,curr) values(myseq.nextval,myseq.currval);
JH zz1l^+]!n~d&d0insert into testseq(next,curr) values(myseq.nextval,myseq.currval);
+x p*S^u,k$c0insert into testseq(next,curr) values(myseq.nextval,myseq.currval);
%s^;YS!Z%I0insert into testseq(next,curr) values(myseq.nextval,myseq.currval);51Testing软件测试网bUb?x
insert into testseq(next,curr) values(myseq.nextval,myseq.currval);51Testing软件测试网G};k)] ^0_m
insert into testseq(next,curr) values(myseq.nextval,myseq.currval);
obA#@9m5rE0insert into testseq(next,curr) values(myseq.nextval,myseq.currval);
kQdN db'_z"E.ax0insert into testseq(next,curr) values(myseq.nextval,myseq.currval);51Testing软件测试网-E!Q|\~w1_1Xm:d
insert into testseq(next,curr) values(myseq.nextval,myseq.currval);
[4Lvxvw0f!s05、查询表数据:
WSif1ea H0v9N@g-COQr
Xm0select * from testseq;51Testing软件测试网0y$O#f(f_ t'k
结果:在附件中
)XZ'a.?f6~;u051Testing软件测试网k$}t4L3TG
FoO"Bg2?g0