select
mobileNo,sendTime
from
(
select
substring
(
convert
(
char
(
50
),mobileNo),
1
,
7
)
as
mobileNo,sendTime
from
dbo.SmsSendRecord) a
where a.mobileNo in ( select convert ( char ( 50 ),mobileNo) from Table_3 where code = 832 )
and a.sendTime between ' 2009-6-8 ' and ' 2009-6-14 '
where a.mobileNo in ( select convert ( char ( 50 ),mobileNo) from Table_3 where code = 832 )
and a.sendTime between ' 2009-6-8 ' and ' 2009-6-14 '