添加split.sql文件

This commit is contained in:
吴长征 2024-09-05 16:28:19 +08:00
parent 942cda9530
commit aafdd79c5e

17
sql/split.sql Normal file
View File

@ -0,0 +1,17 @@
--JK_CRB_ICD10表icd10列按照name和icd10联合组成新行JK_CRB_ICD10_tmp表
~~~sql
insert into JK_CRB_ICD10_tmp
select * from (
SELECT name,
TRIM(SUBSTR(string_to_split,
INSTR(string_to_split, '', 1, LEVEL) + 1,
INSTR(string_to_split, '', 1, LEVEL + 1) - INSTR(string_to_split, '', 1, LEVEL) - 1)
) AS icd10
FROM (SELECT name, '' || icd10 || '' AS string_to_split FROM JK_CRB_ICD10) t,
DUAL
CONNECT BY PRIOR name = name
AND PRIOR DBMS_RANDOM.value IS NOT NULL
AND LEVEL <= LENGTH(t.string_to_split) - LENGTH(REPLACE(t.string_to_split, '', '')) + 1
) ina where ina.icd10 is not null;
~~~