有条sql语句 select * from a where a.catid in('1,2,3,4,5,6,7,8,9,0');
就会查询不出来东西,但是如果用
select * from a where a.catid in(1,2,3,4,5,6,7,8,9,0);
就可以查询出来东西
再者 select* from a where a.catid in('1,2'); 也可以求高手解释

解决方案 »

  1.   

    select * from a where a.catid in('1','2','3','4','5','6','7','8','9','0');
    select * from a where a.catid in(1,2,3,4,5,6,7,8,9);
      

  2.   

    select * from a where find_in_set('1,2,3,4,5,6,7,8,9,0',a.catid)>0;
    是动态执行语句?详细说明
      

  3.   

    如果你的a.catid 是数字型,则当然需要用 where a.catid in(1,2,3,4,5,6,7,8,9,0);
    如果你的a.catid是字符型,则你需要考虑你的IN中到底是什么? '1,2' 只是一个字符串,并不是两个数字 1,2
      

  4.   

    楼上说的对,要看catid里存的是什么类型的数据。