SELECT
posts.idPost,
users.loginUser,
posts.datePost,
posts.idUserPost
FROM posts
INNER JOIN users
ON posts.idUserPost = users.idUser
WHERE posts.idRecordPost IN (83, 91)
ORDER BY posts.datePost DESC
SELECT * FROM (
SELECT ....... ROW_NUMBER() OVER (PARTITION BY posts.idRecordPost ORDER posts.datePost DESC) row_num
FROM .....
....
WHERE posts.idRecordPost IN (83, 91)
) t
WHERE t.row_num = 1