隨筆-124  評論-49  文章-56  trackbacks-0

           

           select b.promo_number,b.payment_time,b.validity_days,a.tim,b.goods_name,b.payment_time+b.validity_days from 
                  (
          select max(m.send_time) tim 
                  
          from tb_payment_promo_log p,tb_mobile_log m  
                  
          where p.goods_id=615732 and p.user_name='ywj123' 
                  
          and p.promo_number=m.operate 
                  
          and   p.user_name = m.user_name ) a , tb_payment_promo_log b,tb_mobile_log c 
                  
          where b.goods_id=615732 and b.user_name='ywj123' and   b.user_name = c.user_name  and a.tim = c.send_time
                  
          order by b.payment_time desc

          select t3.usid,t3.usname,t3.usarea,t3.cell from 
          (
          select  t2.cellphone cell,max(t1.game_money+t1.bank_game_money) money,t1.user_id usid,t1.user_name usname,t1.user_area usarea from tb_rd_user_info t1,tb_rd_user_info2 t2
          where t1.login_tim <= sysdate-7 and t1.login_tim > sysdate-8 and t1.user_id = t2.user_id and t2.cellphone is not null
          group by t2.cellphone,t1.user_id,t1.user_name,t1.user_area) t3 
          where t3.money < 500000
          posted on 2009-12-10 11:55 junly 閱讀(307) 評論(0)  編輯  收藏 所屬分類: oracle/mysql/sql
          主站蜘蛛池模板: 桦甸市| 辽源市| 武义县| 清涧县| 武邑县| 安宁市| 抚松县| 镇巴县| 宁阳县| 稻城县| 宜君县| 右玉县| 柳林县| 东港市| 正镶白旗| 青铜峡市| 鄂托克前旗| 宁都县| 南平市| 溧阳市| 台中县| 梧州市| 罗甸县| 乳山市| 定兴县| 增城市| 海盐县| 大姚县| 永德县| 灵丘县| 滨州市| 墨竹工卡县| 西和县| 奈曼旗| 邵阳县| 张家口市| 淳安县| 德庆县| 永寿县| 富源县| 千阳县|