1. 必须确保dba_objects表有足够数据
select rownum from dba_objects where rownum < br style='font-size:12px;font-style:normal;font-weight:normal;color:rgb(102, 102, 102);' />
2. 递归的with
with data(x) as(
select 1 x from dual
union all
select x+1 from data where x < br style='font-size:12px;font-style:normal;font-weight:normal;color:rgb(102, 102, 102);' />)
select x from data;
3. connect by level写法
select level from dual connect by level < br style='font-size:12px;font-style:normal;font-weight:normal;color:rgb(102, 102, 102);' />
4.xmltable法
select * from xmltable('1 to 10000' columns n int path '.');
select rownum from dba_objects where rownum < br style='font-size:12px;font-style:normal;font-weight:normal;color:rgb(102, 102, 102);' />
2. 递归的with
with data(x) as(
select 1 x from dual
union all
select x+1 from data where x < br style='font-size:12px;font-style:normal;font-weight:normal;color:rgb(102, 102, 102);' />)
select x from data;
3. connect by level写法
select level from dual connect by level < br style='font-size:12px;font-style:normal;font-weight:normal;color:rgb(102, 102, 102);' />
4.xmltable法
select * from xmltable('1 to 10000' columns n int path '.');
本文介绍了使用SQL的几个关键技巧,包括查询dba_objects表、递归查询数据、使用connect by level语法及XMLTable法。深入探讨了这些SQL功能的应用与实现方式。
240

被折叠的 条评论
为什么被折叠?



