select a.email as email, p.id_post as id_post, (p.publicated_to - NOW()) as days_left
from publications as p inner join authors as a on p.author_id = a.id
where p.publicated_to > NOW()
select u.email, p.post_id, TIMESTAMPDIFF(DAY, p.publicated_to, now())
from users u
join posts p ON user_id =u.id