ORACLE向表中插入1到20,按照往常,第一反应会想到写个小程序来完成此功能。
SQL> create table tc(id int);
Table created.
SQL> insert into tc SELECT LEVEL AS ID FROM dual CONNECT BY LEVEL <= 20;
20 rows created.
SQL> commit;
Commit complete.
SQL> select * from tc;
ID
----------
1
2
3
4
5
6
7
8
9
10
11
ID
----------
12
13
14
15
16
17
18
19
20
20 rows selected
.