Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select count(*) from (
- select * FROM social_shares s JOIN news_items n ON s."news_item_UID" = n."UID"
- WHERE category = 'test'
- AND
- (n.claimed_timestamp >= now() - INTERVAL '24 hours' AND s.last_update_at < now() - INTERVAL '5 minutes')
- UNION ALL
- SELECT * FROM social_shares s JOIN news_items n ON s."news_item_UID" = n."UID"
- WHERE category = 'test'
- AND s.last_update_at IS null
- )q;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement