22,207
社区成员
发帖
与我相关
我的任务
分享
--哦,写错了
select Called_Station_Id,F_User_point,h323_connect_Time from TB_CDR where Calling_Station_Id='0429990001'
and Called_Station_Id like '0[1-9]%'
and len(substring(Called_Station_Id,charindex('99',Called_Station_Id)+2,len(Called_Station_Id)))>4
and convert (varchar(10),convert(dateTime, h323_connect_Time),112) like '200803%'
--try:
select Called_Station_Id,F_User_point,h323_connect_Time from TB_CDR where Calling_Station_Id='0429990001'
and Called_Station_Id like '0[1-9]%'
and len(substring(Called_Station_Id,charindex('99',Called_Station_Id)+1,len(Called_Station_Id)))>4
and convert (varchar(10),convert(dateTime, h323_connect_Time),112) like '200803%'
select Called_Station_Id,F_User_point,h323_connect_Time
from TB_CDR
where Calling_Station_Id='0429990001' and
left(Called_Station_Id,1) = '0' and
cast(substring(Called_Station_Id,2,1) as int) between 1 and 9 and
convert (varchar(6),convert(dateTime, h323_connect_Time),112) = '200803'