declare i number := 0;begin while i < 10 loop insert into tablename values ('张三',10,i); i := i + 1; end loop; end; /i也可以用随机函数
提示 出现符号“end-of-file”在需要下列之一时……是什么原因呢?
create table tt(name varchar2(10),num int) insert into tt select 'aa',5 from dual; insert into tt select 'bb',4 from dual;select a.name,b.rn as num from tt a ,(select rownum as rn from dual connect by rownum<=100) b where a.num>=b.rn order by a.name,b.rn
select a.name,a.noumber,b.rn as xh from tab a,(select rownum as rn from dual connect by rownum<=100) b where a.xh>=b.rn order by a.name,a.noumber,b.rn
i number := 0;begin
while i < 10 loop
insert into tablename values ('张三',10,i);
i := i + 1;
end loop;
end;
/i也可以用随机函数
create table tt(name varchar2(10),num int)
insert into tt select 'aa',5 from dual;
insert into tt select 'bb',4 from dual;select a.name,b.rn as num from tt a ,(select rownum as rn from dual connect by rownum<=100) b
where a.num>=b.rn
order by a.name,b.rn
where a.xh>=b.rn
order by a.name,a.noumber,b.rn
谢谢 有没有SqlServi中对应的 呵呵~!