原表如下
select * from hs_acct.custattach a where a.client_id='888827395';
將列拆分成多行的語句
select * from ( ----將列拆分成多行的語句 select distinct a.client_id ,REGEXP_SUBSTR(a.en_branch_no, '[^,]+', 1, L) AS en_branch_no from hs_acct.custattach a, (SELECT LEVEL L FROM DUAL CONNECT BY LEVEL <= 10000) b WHERE b.L(+) <= LENGTH(a.en_branch_no) - LENGTH(REPLACE(a.en_branch_no, ',')) + 1 ) tt where trim(tt.en_branch_no) is not null and tt.client_id='888827395';