SET @SQLS='select @AllUser=count(1) from (select PhoneId from '+@TABLE+' where SiteId='+convert(VARCHAR(5),@SiteId)+' AND PhoneId<>'''' AND CONVERT(varchar(10), CreateTime, 120)='''+@time+''' group BY PhoneId) tb' exec sp_executesql @SQLS,N'@AllUser int out',@AllUser out
--记录铭心