こんにちは皆さん、次のクエリで mysql にこのエラーがあります。どこが間違っているのかわかりません。助けてくれてありがとう:)
SELECT a.*,b.*,users.*,
(SELECT p.msg_text,p.occured_at
FROM message_private p
WHERE p.group_id=a.group_id
ORDER BY p.occured_at DESC LIMIT 1) as message,
f.countf,message.occured_at
FROM message_group a
INNER JOIN message_group b ON a.group_id=b.group_id
INNER JOIN users ON users.profile_id = b.profile_id
LEFT JOIN
(
SELECT COUNT(profile_id) countf, id_group
FROM message_view
WHERE profile_id = 'sN07X2'
GROUP BY id_group
) f
on f.id_group = b.group_id
WHERE a.profile_id = 'sN07X2'
AND b.profile_id != a.profile_id
AND countf > 0
ORDER BY p.occured_at DESC
LIMIT 9