I need to get emails in result. First need to get users id from two tables and connect it with users table to get email by id. In result I need only unique emails.
Im trying to construct something like this, but don't think it's right
SELECT distinct 'uid','login.email'
FROM 'operations'
left join 'login' on operations.uid=login.id
UNION
SELECT distinct 'uid','login.email'
FROM 'operations24'
left join 'login' on operations.uid=login.id