このクエリがあり、結果が double であるため、DISTINCT に変換する必要があります。どうすればよいですか?
SELECT x.id_msg, x.id_group, x.profile_id, b.id_group, u.name, u.sirname, u.picup, u.profile_id AS profile_id_users, mp.msg_id,mp.msg_text, mp.occured_at
FROM message_view x
INNER JOIN (
SELECT a.id_msg, a.id_group, a.profile_id
FROM message_view a
WHERE a.profile_id = 'sN07X2'
)b ON x.id_group = b.id_group
INNER JOIN users u ON u.profile_id = x.profile_id
INNER JOIN message_private mp ON mp.msg_id = x.id_msg