加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

oracle字符串提取记录

发布时间:2020-12-12 13:24:08 所属栏目:百科 来源:网络整理
导读:背景:需要限制用户操作次数,而用户操作次数只有统一的日志表有记录。 并且,因为在批量查询中也需做限制,所有需要一次查询多条数据,保证效率。后来采用视图做的 ? 视图 instr 查找字符串,返回起始坐标, 坐标从1开始 substr切割字符串,substr(字符串,

背景:需要限制用户操作次数,而用户操作次数只有统一的日志表有记录。 并且,因为在批量查询中也需做限制,所有需要一次查询多条数据,保证效率。后来采用视图做的

?

视图

instr 查找字符串,返回起始坐标, 坐标从1开始

substr切割字符串,substr(字符串,起始坐标,长度)

create or replace view v_log as
--用作批量核查时限制次数
select t2."PHONE_NUMBER",t2."TIME",t2."URL",substr(t2.post_params,instr(t2.post_params,reportTime:)+length(reportTime:),,companyName)-instr(t2.post_params,reportTime:)-length(reportTime:)) as reportTime,companyName:)+length(companyName:),xyCode)-instr(t2.post_params,companyName:)-length(companyName:)) as companyName,xyCode:)+length(xyCode:),zb)-instr(t2.post_params,xyCode:)-length(xyCode:)) as xyCode,,zb:)+length(,zb:),value)-instr(t2.post_params,zb:)-length(,zb:)) as zb,type:)+length(,type:),length(t2.post_params)-instr(t2.post_params,type:)-length(,type:)) as type
from user_log t2
where t2.url like %/check/single;

?

查询结果

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读