Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在由段落“分隔”的表格行中有数据。我需要分别选择和显示每个段落中的数据。
<p>1 The Turtle is slow. </p> <p>2 The Rabbit is fast. </p> <p>3 The Horse eats hay. </p>
甚至有可能做到这一点吗?如果没有,还有其他可能的方法可以使它工作吗?
您可以使用substring_index()基本上做到这一点。
substring_index()
如果你想要第一段:
select replace(substring_index(col, '</p>', 1), '<p>', '')
对于第二个:
select replace(substring_index(substring_index(col, '</p>', 2), '</p>', -1), '<p>', '')