I have two tables, scoreTable and users. I am trying to group by hash on scoreTable but selecting all the user names that have that hash. scoreTable only has the ids
SELECT st.score,
GROUP_CONCAT(st.uid) as userList
FROM scoreTable st
GROUP BY hash
For the above query I get the list of user Ids in userList: '1,2,3,4'
What I would love to get is the actual "names" instead of the ids - the names are on another table (users)
SELECT st.score,
(SELECT group_concat(d.name) from users d d where d.uid = st.uid))
FROM scoreTable st
GROUP BY hash
But for some reason this only displays ONE user (the user with the first id).