3,491
社区成员
发帖
与我相关
我的任务
分享
with tab1 as (
select 15300000 + level num, level rn from dual connect by level <= 100
)
, tab2 as (
select 'A' name from dual union all
select 'B' name from dual union all
select 'C' name from dual
)
, tab3 as (
select t1.*, row_number() over(order by t1.name) - 1 rn, count(1) over() ct from tab2 t1
)
select t1.num, t2.name from tab1 t1, tab3 t2 where mod(t1.rn, t2.ct) = t2.rn;