侧边栏壁纸
  • 累计撰写 56 篇文章
  • 累计创建 59 个标签
  • 累计收到 7 条评论

mysql 截取字符串

时间这孩子很诚实
2022-11-28 / 0 评论 / 0 点赞 / 65 阅读 / 201 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-11-28,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

数据类型样式

{"bukrs":"F64","batchNo":"202211110230001807","paymentItem":"非固定资产","batchIndex":390,"processId":"QZ221107000085","filePath":"http://10.128.85.133:9902/want/invoice/download?fileId=x9MnFtbJ0SM=","pullDate":"20221110","bukrsName":"南京旺旺食品有限公司"}

获取processId的表单号

update pdt_i_want_pull_origin set process_id = SUBSTRING(substring_index(origin_data,"processId",-1),4,14)
WHERE deleted = 0 and type =0 and origin_channel = 'BPM' and process_id is null

sql说明

substring_index(str, delim, count),即:substring_index(被截取字符串,关键字,关键字出现的次数)
substring(str, index),即:substring(被截取字符串, 从第几位开始截取)
substring(str, index, length),即:substring(被截取字符串,从第几位开始截取,截取长度)

0

评论区