随笔-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 阅读(273) 评论(0)  编辑  收藏 所属分类: oracle/mysql/sql

只有注册用户登录后才能发表评论。


网站导航: