I'm trying to separate the IDPosts column as a single row for each ID (attempting to create a favorite post list). The column next to it has all of the proper columns listed but are grouped, I want to obtain a row for each one grouped together in the favuserposts column. See my picture and query below. Please let me know if you need more information.
Displays everything but cannot display multiple favorite post IDs:
SELECT Users.IDUser,
Users.username,
Users.profile_picture,
Favorites.IDPosts,
GROUP_CONCAT(DISTINCT coalesce(Favorites.IDPosts,'')) as "favuserposts",
( Select body
from Posts
where Favorites.IDPosts=Posts.IDPosts
AND Users.IDUser=Favorites.IDUser)
FROM Users
LEFT OUTER JOIN Favorites ON Favorites.IDUser = Users.IDUser
GROUP BY Users.IDUser HAVING COUNT(IDPosts)>0;