1、创建测试表,
create table test_loop(id varchar2(20),remark varchar2(20))
2、循环插入测试数据;
begin
for i in 1..100 loop
insert into test_loop
values(i,'level_'||i)
end loop
commit
end
3、查询表中全量数据;select t.*, rowid from test_loop t
4、编写语句,查询表中记录数,可以看到结果为100;
select count(*) sec from test_loop t
数量多的话用insertselect方法插入,如果只是纯数字的话,可以用系统表
insert
into
tb
(a,b)
select
a.number,b.number
from
master..spt_values
a,master..spt_values
b
where
a.type='p'
and
b.type='p'
and
a.number
between
1
and
100
and
b.number
between
1
and
5
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)