Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 删除Oracle中带有或200和x标题_Sql_Oracle - Fatal编程技术网

Sql 删除Oracle中带有或200和x标题

Sql 删除Oracle中带有或200和x标题,sql,oracle,Sql,Oracle,我需要删除所有的html标签。我使用regexp_replace,但当文本中有>或200和x标题 应为:head1正文:x>200和x

我需要删除所有的html标签。我使用regexp_replace,但当文本中有>或<字符时,它会失败

WITH T AS
(SELECT '<HTML><HEAD>head1</HEAD><BODY>body<P>text: x > 200 and x < 1000;</P><H1>headline</H1></BODY></HTML>' STR FROM DUAL
)
select REGEXP_REPLACE(STR, '<[^>]+>|\&(nbsp;)|(amp;)', ' ') from T;
输出为:标题1正文文本:x>200和x标题


应为:head1正文:x>200和x<1000;标题

如果您有有效的XML/XHTML注意:使用 | TEXT | | :------------------------------------------- | | head1bodytext: x > 200 and x < 1000;headline | | TEXT | | :----------------------------------------------------------- | | head1 body text: x &gt; 200 and x &lt; 1000; headline |