首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在MySQL 5.7中提取HTML标记中的数据

在MySQL 5.7中提取HTML标记中的数据
EN

Stack Overflow用户
提问于 2022-06-14 21:55:19
回答 1查看 29关注 0票数 0

我试图从html标签中增加额外的数据。我创建了一个像t中那样充当split_string的函数。虽然它的工作不一致,并且想知道其他人发现了什么。我将尝试包括一个例子,但它可能不起作用,因为它上到处都是html标记。

代码语言:javascript
复制
<div class="sub-sub-head"><b>Overview:</b></div>Establish and maintain an accurate, detailed, and up-to-date inventory of all enterprise assets with the potential to store or process data, to include: end-user devices (including portable and mobile), network devices, non-computing/IoT devices, and servers. Ensure the inventory records the network address (if static), hardware address, machine name, data asset owner, department for each asset, and whether the asset has been approved to connect to the network. For mobile end-user devices, MDM type tools can support this process, where appropriate. This inventory includes assets connected to the infrastructure physically, virtually, remotely, and those within cloud environments. Additionally, it includes assets that are regularly connected to the enterprise’s network infrastructure, even if they are not under control of the enterprise. Review and update the inventory of all enterprise assets bi-annually, or more frequently.<br/><br/>
 
 <div class="sub-sub-head"><b>Action Items:</b></div>1) Maintain a detailed Hardware Asset Inventory.<br/>
 
 <div class="sub-sub-head"><b>Additional Guidance:</b> </div>Asset Type: Devices <br> <br>
 Security Function: Identify
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-23 17:18:28

使用substring_index来拆分;对于每个字段,您要调用它两次,一次是为了获得第一个N字段,另一次是从该字段获得最后一个字段:

代码语言:javascript
复制
select
    substring_index(substring_index(bar, '<div class="sub-sub-head">', 2), '<div class="sub-sub-head">', -1) overview,
    substring_index(substring_index(bar, '<div class="sub-sub-head">', 3), '<div class="sub-sub-head">', -1) action_items,
    substring_index(substring_index(bar, '<div class="sub-sub-head">', 4), '<div class="sub-sub-head">', -1) guidance
from foo;

小提琴

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72623812

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档