MySQLにこのクエリがあります
SELECT
@rownum:=@rownum+1 AS rownum,
notifications_posts.from_user AS source,
notifications_posts.on_post_id AS destination,
notifications_posts.in_group_id,
groups.group_name AS group_name,
notifications_posts.on_post_id AS other_record_id,
user_info.first_name,
user_info.last_name,
user_info.user_id,
notifications_posts.date,
posts.title AS 'title',
user_rights.right AS 'right',
'article' AS notification_type
FROM notifications_posts
INNER
JOIN user_info
ON notifications_posts.from_user = user_info.user_id
INNER
JOIN posts
ON posts.id = notifications_posts.on_post_id
INNER
JOIN groups
ON groups.group_id = notifications_posts.in_group_id
INNER
JOIN user_rights
ON user_rights.group_id = notifications_posts.in_group_id AND user_rights.user_id = user_info.user_id
そして私は得る
なぜ私はで取得NULL
するのrownum
ですか?
次に、その ID でレコードをグループ化する必要があります
GROUP BY rownum;
誰でも私を助けることができますか?