在oracle中,一个字段里有如下几个值:1,2,3
我想要得到这个字段中不带3的另外2个值,就是得到1,2
请大家帮忙看看!!!谢谢

解决方案 »

  1.   

    直接用substr函数就行了。 substr(字段,1,3) 
      

  2.   

    那如果就想要上面写的那样!该如何去写,请写出sql语句!谢谢
      

  3.   

    自己百度,substr函数和instr函数
      

  4.   

    instr判断不想要的字符,
    replace把不想要的替换掉,
    substr截取,具体自己去实现吧
      

  5.   

    select replace(replace('123456789',3),2)  aa from dual
      

  6.   

    select replace(字段名,'3','')from 表名
      

  7.   

    select replace(replace(字段名,要去掉的字符,''),',,',',') from table_name
      

  8.   

    select replace(replace(字段名,要去掉的字符,''),',,',',') from table_name