Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- w.id AS watch_id,
- w.social_id as social_id,
- COUNT(social_id) as watchers
- FROM
- watches w
- INNER JOIN livedune.users u ON u.id = w.user_id
- INNER JOIN livedune.user_access a ON a.user_id = u.id AND a.access = 'business'
- WHERE
- w.is_linked = 1
- AND w.type = 'instagram_new'
- AND w.comments_enabled = 1
- AND a.end < DATE_SUB(NOW(), INTERVAL 7 DAY)
- GROUP BY
- social_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement