SELECT p.id 
FROM Posts as p
JOIN (
	SELECT id
	, MAX(date_modified) as ModifiedDate
	FROM Posts
	GROUP BY user_id
) lastPost ON p.id = lastPost.id 
AND p.date_modified = lastPost.ModifiedDate
order by p.user_id