RT———————————————————————————————————
表Test里面有字段,ID和CODE,序列SEQ_ID,数组{100,101,102,103,104,105,106}
别想一个个写,我现在的数组是165个元素——————————————————
求大神指点SQL——————————————————————————————
------解决方案--------------------
--数组的不会,只会拆会字符串的,我也是菜鸟
select a.*,b.* from (
select regexp_substr('1001,1002,1003,1004,1005', '[^,]+', 1, level) from dual
connect by level <= 5) a,
(select 1 as fid, 'a' as code from dual union all
select 2,'b' from dual) b
--不写关联条件,组成一个迪卡尔集,不知道是这样子的不
REGEXP_SUBSTR('1001,1002,1003,1004,1005','[^,]+',1,LEVEL) FID CODE
------------------------------------------------------------ ---------------------- ----
1001 1 a
1001 2 b
1002 1 a
1002 2 b
1003 1 a
1003 2 b
1004 1 a
1004 2 b
1005 1 a
1005 2 b