Advertisement
Guest User

nguyen

a guest
Dec 10th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #短信重提 定时短信 接收状态或者未知重提
  2. select * from mt as a
  3. inner join message as b on a.message_id = b.id
  4. where a.customer_id = 1 and a.isDE = 0 and a.isp in (1,2,3)
  5. and b.plan_at >= curdate() and b.plan_at <= curdate()
  6. and b.id = 1 and a.ispayback = 0 and a.sms_source = 1
  7. and a.reply_response = 'MK:0001' and a.ispayback = 0
  8. [改成] SỬA THÀNH:
  9. select * from mt as a
  10. inner join message as b on a.message_id = b.id
  11. where a.customer_id = 1 and a.isDE = 0 and a.isp in (1,2,3)
  12. and b.plan_at >= curdate() and b.plan_at <= curdate()
  13. and b.id = 1 and a.ispayback = 0 and a.sms_source = 1
  14. and a.reply_response = 'MK:0001' and a.ispayback = 0
  15. union all
  16. select * from mt_nextoneday as a
  17. inner join message as b on a.message_id = b.id
  18. where a.customer_id = 1 and a.isDE = 0 and a.isp in (1,2,3)
  19. and b.plan_at >= curdate() and b.plan_at <= curdate()
  20. and b.id = 1 and a.ispayback = 0 and a.sms_source = 1
  21. and a.reply_response = 'MK:0001' and a.ispayback = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement