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就是得到的数据
regtime >'2009-10-14'and regtime<'2009-10-15'这个不就是 regtime ='2009-10-14' 吗?
(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 ?
DATEDIFF(DD,regtime,'2009-10-14')=0