Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from activities
- join elements where elements.id = activities.element_id
- where activities.site_id = 7
- and not exists(
- select * from activities as newer
- where newer.element_id = elements.element_id
- and newer.updated_at > elements.updated_at
- )
- limit 10
Add Comment
Please, Sign In to add comment