oplog是cbob类型,数据有可能是下面的:
------数据1-----
[基本警情框]
警情编号=20160---0017G0080
接警时间=2016-03-14 02:27:23
报警类型=110
联系电话=1897------01
身份及其它=男
值班长=黄平
原始警情性质=问电话
标志建筑=--省---镇;020乡道附近;中心洲、麻子坜、袁屋
[警情特征]
新添警情内容=来电人称:
新添处警情况=
[数字录音]
录音号=2016031401100019D 02:27:23
录音号=2016031401100019D 02:28:07
------数据2-----
[基本警情框]
警情编号=2016---40001H0020
接警时间=2016-03-14 00:01:12
报警类型=110
联系电话=1501---6228
身份及其它=男
值班长=
[警情特征]
新添警情内容=来电人称:
新添处警情况=
----------------
需要取数据中含有 标志建筑 的内容部分
select oplog from jqcase t WHERE T.JQTIME>='2016-03-14 00:00:00' and oplog like '%标志建筑=%'
select jqno,jqtime,oplog,substr(oplog,(instr(oplog,'标志建筑=')),((instr(oplog,'[警情特征]')-(instr(oplog,'标志建筑='))))) from jqcase t
WHERE T.JQTIME>='2016-03-14 00:00:00' --and oplog like '%标志建筑=%' and
select jqno,jqtime,oplog ,case when (instr(oplog,'标志建筑='))>0 then substr(oplog,(instr(oplog,'标志建筑=')),((instr(oplog,'[警情特征]')-(instr(oplog,'标志建筑='))))) else '' end
from jqcase t
WHERE T.JQTIME>='2016-03-14 00:00:00' --and oplog like '%标志建筑=%'
----------final SQL-----------
select jqno,jqtime,oplog ,case when (instr(oplog,'标志建筑='))>0 then substr(oplog,(instr(oplog,'标志建筑=')+5),((instr(oplog,'[警情特征]')-(instr(oplog,'标志建筑='))-5))) else '' end
from jqcase t
WHERE T.JQTIME>='2016-03-14 00:00:00' --and oplog like '%标志建筑=%'
相关推荐
oracle 截取字符(substr),检索字符位置(instr) case when then else end语句使用
substr 函数:截取字符串 语法:SUBSTR(string,start, [length]) string:表示源字符串,即要截取的字符串。 start:开始位置,从1开始查找。如果start是负数,则从string字符串末尾开始算起。 length:可选项...
oracle 截取字符(substr),检索字符位置(instr) case when then else end语句使用 收藏 常用函数:substr和instr 1.SUBSTR(string,start_position,[length]) 求子字符串,返回字符串 解释:string 元字符串 start_...
在实际工作中经常遇到截取两个相同字符串之间的字符的oracle问题,以下是相关语句
对于截取字符串,Oracle中有两个函数substr(),instr()截取规则的字符串使用起来较为方便,这里重新封装了一个函数 --调用函数参数说明: --num_char(str1 varchar2,str2 varchar2,indexs number) --str1 原字符串 --...
substr(字符串,截取开始位置,截取长度) //返回截取的字 substr(‘Hello World’,0,1) //返回结果为 ‘H’ *从字符串第一个字符开始截取长度为1的字符串 substr(‘Hello World’,1,1) //返回结果为 ‘H’ *0和1都...
--字符串截取substr(字段名,起始点,个数) select Name,substr(Name,2,4),substr(Name,0,3),substr(Name,-2,3),substr(Name,-2,1) from t1; --字符串从前面取三个(0开始) select Name,substr(Name,0,3) from t1; --...
Oracle截取JSON字符串内容 ,具体代码如下所示: CREATE OR REPLACE FUNCTION PLATFROM.parsejsonstr(p_jsonstr varchar2,startkey varchar2,endkey varchar2) RETURN VARCHAR2 IS rtnVal VARCHAR2(1000); ...
简单来说是本身可视为电子化的文件柜——存储电子文件的处所,用户可以对文件中的数据运行新增、截取、更新、删除等操作。 常见的数据模型 1. 层次结构模型: 层次结构模型实质上是一种有根结点的定向有序树,IMS...
语法: –1.REGEXP_SUBSTR与SUBSTR函数相同,返回截取的子字符串 REGEXP_SUBSTR(srcstr, pattern [, position [, occurrence [, match_option]]]) 注: srcstr 源字符串 pattern 正则表达式样式 position 开始匹配...
在一个字符串中搜索指定的字符,返回发现指定的字符的位置; C1 被搜索的字符串 C2 希望搜索的字符串 I 搜索的开始位置,默认为1 J 出现的位置,默认为1 SQL> select instr('oracle traning','ra',1,2) instring ...
在一个字符串中搜索指定的字符,返回发现指定的字符的位置; C1 被搜索的字符串 C2 希望搜索的字符串 I 搜索的开始位置,默认为1 J 出现的位置,默认为1 SQL> select instr('oracle traning','ra',1,2) instring from ...
substr:截取字符串 Oracle当中substrate()函数的截取的索引从0或从1开始都可以。 Initcap:字符的首字母大写 Lpad:向字符串的左侧添加字符 Rpad:向字符串的右侧添加字符 Instr:是否包含某字符,从第几个字符开始...