select id from t_a where instr('1211,1311,1411',id)>0

解决方案 »

  1.   

    但是这样做会有问题的,如12、211、13等这些id都回选出来,如果这个字符串是你自己拼出来的最好拼成这样',1211,1311,1411,'然后用:select id from t_a where instr('1211,1311,1411',','||id||',')>0 这样就没问题了,如果要用到外关联什么的就要用like,如:'%,'||id||',%' like ',1211,1311,1411,'
      

  2.   

    select id from t_a where id like '1%11'
      

  3.   

    select * from mis_menu where instr('1211,1311,1411',menu_id)>0;
    偶这样为虾米不行 menu_id 是mis_menu的一个字段
    编号如1211这个样子的
    但是记录都没有出来
      

  4.   

    我把字符串弄成"1211,1511,2111,"这个样子
    然后
    select * from mis_menu where '%menuid,%' like "1211,1511,2111,"
      

  5.   

    select id from t_a where id like '1_11'
      

  6.   

    select id from t_a where instr('1211,1311,1411',id)>0 and len(id)=4;
      

  7.   

    select id from t_a where instr('1211,1311,1411',id)>0 and length(to_char(id))=4;
      

  8.   

    select id from t_a where id in ('1211','1311','1411')
      

  9.   

    try:1. select * from mis_menu where instr('1211,1311,1411',trim(menu_id))>0;
    2. select * from mis_menu where trim(menu_id) in (substr('1211,1311,1411',1,4),substr('1211,1311,1411',6,4),substr('1211,1311,1411',11,4))
      

  10.   

    select * from tablename where id in (1211,1311,1411)
      

  11.   

    谢谢各位了
    偶用
    select id from t_a where instr('1211,1311,1411',trim(id))>0 and len(trim(id))=4;
    十分感谢