Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT count(s.subscription_id) AS count
- FROM subscriptions s JOIN wallets w USING (business_id)
- WHERE
- w.entry_id IS NOT NULL
- AND w.last_four IS NOT NULL
- AND s.annual = TRUE
- AND s.auto_renew = TRUE
- AND s.state = 'ACTIVE'
- AND date_add(s.start_date, INTERVAL 1 YEAR) = current_date;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement