字段名OCONTENT   VARCHAR2(2000)
select ocontent as 选项,replace(ocontent,'<div>','') as 选项1,replace(ocontent,'</div>','') as 选项2 出现以下结果<div>A.很好</div>      A.很好</div>      <div>A.很好目标要把<div>和</div>都替换掉,得出
A.很好
这个结果,怎么写,立马结贴

解决方案 »

  1.   

    select ocontent as 选项,replace(replace(ocontent,' <div>',''),'</div>','') as 选项1
    from tb;
      

  2.   

    SELECT OCONTENT AS 选项,
           REPLACE(REPLACE(OCONTENT, '</div>', ''), '<div>', '') AS 选项3
      FROM T;
      

  3.   

    要替换两次,如果只要一个结果值:
    select replace(replace(ocontent,' <div>',''),' </div>','') as 选项 
    from tb; 
      

  4.   

    select replace(replace(ocontent,' <div>',''),' </div>','') as 33
    as后面跟数字为什么就不行了?
      

  5.   


    要加双引号
    select replace(replace(ocontent,' <div>',''),' </div>','') as "33" 
      

  6.   

    Oracle10g用正则表达式select regexp_replace(ocontent,'(<)(/)?(div>)','') from t