select agent,phonenum from A.C where len>'45'and starttime >'2009-10-14'and endtime<'2009-10-15' 
select cphone from B.D where regtime >'2009-10-14'and regtime<'2009-10-15'state!='订购'符合要提取的数据是要在(select cphone from B.D where regtime >'2009-10-14'and regtime<'2009-10-15'state!='订购')中得到 cphone,cphone中的数据符合(select agent,phonenum from A.C where len>'45'and starttime >'2009-10-14'and endtime<'2009-10-15' )中的条件,phonenum就是得到的数据

解决方案 »

  1.   


    regtime >'2009-10-14'and regtime<'2009-10-15'这个不就是  regtime ='2009-10-14'  吗?
      

  2.   

    regtime >'2009-10-14'and regtime<'2009-10-15'这个不就是  datediff(day,regtime,'2009-10-14')=0  吗?
      

  3.   

    SELECT A.phonenum 
    (select agent,phonenum from A.C where len>'45'and starttime >'2009-10-14'and endtime<'2009-10-15' )AS A
    ,
    (
    select cphone from B.D where regtime >'2009-10-14'and regtime<'2009-10-15'state!='订购'
    )AS B
    WHERE A.phonenum =B.cphone ?
      

  4.   

    这个是等于,
    DATEDIFF(DD,regtime,'2009-10-14')=0
      

  5.   

    regtime是datetime类型我没有写全“2009-10-15 16:03:56.467”