select * from SECRITY where ','||DEPLIST||','  like '%,0101,%'

解决方案 »

  1.   

    select * from SECRITY where DEPLIST like '0101%';
    select * from SECRITY where substr(DEPLIST,1,4) = '0101';
      

  2.   

    select * from SECRITY where DEPLIST = '0101'不就行了
    有点清楚你的意思
      

  3.   

    是不是有空格啊,,,去掉空格看看,ltrim(rtrim(DEPLIST))
      

  4.   

    对不起,看错你的意思了,还是按照onejune4450(中文字符)的写法吧。
      

  5.   

    select * from SECRITY where DEPLIST like '0101%'这样应该可以的!
      

  6.   

    select * from SECRITY where instr(DEPLIST,'0101')>0;
      

  7.   

    select * from SECRITY where 
    DEPLIST like '%,0101' 
    or deplist like '0101,%'
    or deplist like '%,0101,%';
      

  8.   

    select * from SECRITY where DEPLIST like '0101%';
      

  9.   

    select * from SECRITY where DEPLIST like '%0101%'
      

  10.   

    应该解决了吧, 这么多思路。
    不过,我觉得你的数据库当中应该有一个部门的表,以保持数据的完整性。是吧!
    到时候查询就更容易了
    select * from table1 where table1.id in (select  table2.id from table2)