select datetime,action_id from messagelog m inner join users u on m.user_id=u.user_id where u.name='Иванов' order by m.datetime