select * from custinfo where custid in(select custid from fundinfo where custid between 4887656 and 4887735
)
查不出东西来了,是怎么回事.是不是表的结构上有什么影响(原来可以).用这个语句 .select * from custinfo where custid in
(
4887656,
4887735
)就可以 .这是怎么回事?

解决方案 »

  1.   

    select   custid   from   fundinfo   where   custid   between   4887656   and   4887735
    有没有返回
      

  2.   

    select   custid   from   fundinfo   where   custid   between   4887656   and   4887735 你 这样查..有记录吗?
      

  3.   

    看看返回什么..
    如返回111542然后再查custinfo表,
    select * from custinfo where custid=111542
    看看有没有记录.如果有..
    select * from custinfo where custid in 
    (
    select custid from fundinfo where custid between 4887656 and 4887735 

    也应该有的..不然再试试这样..select a.*
    from 
     custinfo a,
      (select custid from fundinfo where custid between 4887656 and 4887735) b
     where a.custid=b.custid
      

  4.   

    select   *   from   custinfo   where   custid   in 

    select   custid   from   fundinfo   where   custid   between   4887655   and   4887736
      

  5.   

    select * from custinfo where custid in (4887656,4887735) 

    select * from custinfo where custid in (select custid from fundinfo where custid between 4887656 and 4887735) 
    2句SQL 结果不一定一样的。
    前者最多2条记录,
    后者between 4887656 and 4887735 可能有2天,也可能多于2条。
    明白我意思吗?