用hierachical query,即connect by配合dual表生成序列,mod这个是取余函数,生成group factor。最后面的connect by rownum <= 100可以替换为connect by level <= 100
select case when mod(rownum,200000) = 0 then 5 else mod(rownum,4) end X, LEVEL Lvl, rpad( ‘x‘, 100, ‘x‘ ) data from dual connect by rownum <= 100
时间: 2024-10-05 04:09:26