Вы можете запросить объединение, чтобы извлечь данные из разных таблиц и сохранить их в виде.Вот общая идея ...
create view 'v_recent_activity' as
select user_id, 'comment' as action, comment_text as action_info, comment_date as action_date from comments
union
select user_id, 'photo' as action, photo_url as action_info, photo_date as action_date from photos
union
select user_id, 'page' as action, page_url as action_info, comment_date as action_date from pages
union
select user_id, 'likes' as action, like_info as action_info, comment_date as action_date from likes
union
select user_id, 'shares' as action, share_info as action_info, share_date as action_date from shares
Тогда вы можете получить к нему что-то вроде
Select * from v_recent_activity where action_date between <begin_date> and <end_date>
или с объединением
Select a.*, b.* from users a join v_recent_activity b on a.id = b.user_id where a.id = <user_id> and b.action_date between <begin_date> and <end_date>