首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

proc 储过程

SET QUOTED_IDENTIFIER ON  GO SET ANSI_NULLS ON  GO –**分类报表存储过程 ALTER  proc gnfl_proc  as  declare @p_phone varchar(30), @p_sex int, @p_age int, @p_city varchar(50), @p_r_type int, @p_r_time datetime,    @v_ping     int, –PING码上行总计      @v_ping_ejj int, –PING码上行其中EJJ用户数    @v_ping_bjj int, –PING码上行其中BJJ用户数    @v_ping_con int, –PING码上行中注册和未注册的用户(consumer)不含发送EJJ/BJJ用户    @v_ping_reg     int, –发送PING码并注册的用户(含不在同一天注册的用户)    @v_ping_reg_ejj int, –发送PING码并注册且发送过EJJ的用户    @v_ping_reg_bjj int, –发送PING码并注册且发关过BJJ的用户    @v_ping_reg_con int, –发送PING码注册的用户(consumer)不含发送过EJJ/BJJ的用户    @v_ping_noreg     int, –发送PING码未注册的用户    @v_ping_noreg_ejj int, –发送PING码未注册而且发送了EJJ的用户    @v_ping_noreg_bjj int, –发送PING码未注册而且发送了BJJ的用户    @v_ping_noreg_con int, –发送PING码未注册也示发送EJJ/BJJ的用户(consumer)]    @v_man    int, –男性    @v_women  int, –女性    @v_age20  int, –年龄在20岁以下    @v_age29  int, –年龄在20~29岁    @v_age39  int, –年龄在29~39岁    @v_age49  int, –年龄在39~49岁    @v_age50  int, –年龄在49岁以上    @v_citysh int, –上海    @v_citybj int, –北京    @v_cityhz int, –杭州    @v_citygz int, –广州    @v_citysz int, –深圳    @v_cityqt int, –其他城市    @v_ejj_user int, –EJJ用户      1    @v_bjj_user int, –BJJ用户      2    @v_coun int –写入临时表的判断条件 select  –统计男 @v_man=count( case  when usersex=’1′ then 1 else null end ), –统计女 @v_women=count( case  when usersex=’2′ then 1 else null end ),  –统计20岁 @v_age20=count(case       when userAge< 20  then 1     else null     end     ) , –统计29岁 @v_age29=count(case      when userAge< 30 and userAge>19 then 1     else null     end     ), –统计39岁 @v_age39=count(case      when userAge < 40 and userAge>29 then 1     else null     end), –统计49岁 @v_age49=count(case      when userAge < 50 and userAge>39 then 1     else null     end), –统计50岁 @v_age50=count(case      when userAge >49 then 1     else null     end), –统计上海用户 @v_citysh=count(case       when ci

03
领券