不求甚解

此博客为个人学习之用,如与其他作品雷同,纯属巧合。

导航

Q:oracle中blog中截取部分字符串

Posted on 2024-01-17 11:44  三年三班王小朋  阅读(9)  评论(0编辑  收藏  举报

blog报文中获取对应标签字符串

xxx替换成需要查询的标签

to_char(substr(C_INPUT,instr(C_INPUT,'<xxx>')+length('<xxx>'),instr(C_INPUT,'</xxx>')-instr(C_INPUT,'<xxx>')-length('<xxx>'))) as xxx

示例

select
to_char(substr(C_INPUT,instr(C_INPUT,'<patient_name>')+length('<patient_name>'),instr(C_INPUT,'</patient_name>')-instr(C_INPUT,'<patient_name>')-length('<patient_name>'))) as name
from interface_log where c_action='doctor_baseinfo_call' and c_code='emr_server' and C_STUTS='-2'
and C_INF_TIME>sysdate-10 and C_INF_TIME<sysdate-3 order by C_INF_TIME desc