sql思路

 

  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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值