INSERT INTO YourTable(YourColumn)
SELECT 1 + (Level -1) * YourIncrement from dual connect by Level < TotalNumbers)
i.e.
INSERT INTO YourTable(YourColumn)
SELECT 1 + (Level -1) * 1 from dual connect by Level < 100)
Run Code Online (Sandbox Code Playgroud)
创建序列1,2,3 ... 99
INSERT INTO YourTable(YourColumn)
SELECT 1 + (Level -1) * 2 from dual connect by Level < 100)
Run Code Online (Sandbox Code Playgroud)
创建序列1,3,5 .. 100
或者你可以使用SEQUENCES
| 归档时间: |
|
| 查看次数: |
3996 次 |
| 最近记录: |