添加split.sql文件
This commit is contained in:
parent
942cda9530
commit
aafdd79c5e
17
sql/split.sql
Normal file
17
sql/split.sql
Normal 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;
|
||||||
|
|
||||||
|
~~~
|
Loading…
Reference in New Issue
Block a user