隨筆-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 閱讀(308) 評論(0)  編輯  收藏 所屬分類: oracle/mysql/sql
          主站蜘蛛池模板: 清河县| 永胜县| 始兴县| 九江市| 陇南市| 宜兴市| 宁武县| 察雅县| 斗六市| 阿拉善左旗| 太仓市| 舞钢市| 渭源县| 娄烦县| 武威市| 奉贤区| 邵阳县| 宝兴县| 东乡族自治县| 兰溪市| 西华县| 金溪县| 交口县| SHOW| 武安市| 龙南县| 庐江县| 霸州市| 黄陵县| 鱼台县| 茂名市| 巴彦县| 定边县| 泉州市| 成安县| 大余县| 大丰市| 罗山县| 古丈县| 四会市| 巴青县|