Jody

           

          一個簡單的存儲過程!

          create procedure wap_data_content_zf as
          declare @data_0 varchar(100)
          declare @date_1 varchar(100)
          declare @date_2 varchar(100)
          declare @yvisit integer
          declare @yadd integer
          declare @mvisit integer
          declare @madd integer


          set @data_0=convert(char(8),getdate(),112)
          set @data_1=convert(char(8),dateadd(day,-1,getdate()),112)
          set @date_2=left(convert(char(30),dateadd(day,-1,getdate()),121),10)

          print @temp_0
          print @temp_1
          print @temp_2

          select @yvisit=count(distinct(mid)) from dbo.wap_log_access_2006_6 where uri='/wap/pd/yysl_yk/index.jsp'
          and mid != ''
          and create_time >= '2006-06-06 00:00:00'
          and create_time <= '2006-06-06 23:59:59'

          select @mvisit=count(distinct(mid)) from dbo.wap_log_access_2006_6 where uri='/wap/pd/mlmhc_yk/index.jsp'
          and mid != ''
          and create_time >= '2006-06-06 00:00:00'
          and create_time <= '2006-06-06 23:59:59'

          select @yadd=count(distinct(mid)) from dbo.wap_log_fee_2006_6 as a
          where a.uri='/wap/pd/yysl_yk/get.jsp'
          and a.mid != ''
          and a.portal_id=0
          and a.create_time >= '2006-06-06 00:00:00'
          and a.create_time <= '2006-06-06 23:59:59'
          and exists(select * from dbo.wapuser as b where a.mid = b.mid and b.serviceid='30050631'
          and b.firsttime >= '2006-06-06 00:00:00'
          and b.firsttime <= '2006-06-06 23:59:59')

          select @madd=count(distinct(mid)) from dbo.wap_log_fee_2006_6 as a
          where a.uri='/wap/pd/mlmhc_yk/get.jsp'
          and a.mid != ''
          and a.portal_id=0
          and a.create_time >= '2006-06-06 00:00:00'
          and a.create_time <= '2006-06-06 23:59:59'
          and exists(select * from dbo.wapuser as b where a.mid = b.mid and b.serviceid='02011095'
          and b.firsttime >= '2006-06-06 00:00:00'
          and b.firsttime <= '2006-06-06 23:59:59')

          insert into wap_data_content_zf wap(date,mvisit,madd,yvisit,yadd)
          ?????? values(@temp_2,@mvisit,@madd,@yvisit,@yadd)

          posted on 2006-06-26 14:23 zhaofei1394 閱讀(281) 評論(0)  編輯  收藏 所屬分類: SQL Server

          導航

          統計

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          友情鏈接

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 芜湖市| 贵阳市| 平乐县| 微博| 丹巴县| 石嘴山市| 连城县| 城固县| 武清区| 青岛市| 隆子县| 朝阳区| 新余市| 固镇县| 扎赉特旗| 许昌县| 湖州市| 贵港市| 高要市| 邵武市| 襄汾县| 民乐县| 舟山市| 应用必备| 克拉玛依市| 娱乐| 金堂县| 邹平县| 太仆寺旗| 拉萨市| 临汾市| 天门市| 万荣县| 胶州市| 长武县| 临安市| 荔波县| 阿瓦提县| 漠河县| 仁怀市| 红原县|