Welcome Guest, Not a member yet? Register   Sign In
How to get results from a joined query
#2

[eluser]vitoco[/eluser]
hi , i don't know exactly how "GROUP_CONCAT" works , but you can explicitly set the field name with 'AS' in this way

Code:
SELECT    
    a.users_id,
    a.users_username,
    GROUP_CONCAT(b.game_id SEPARATOR ' ' ) AS game_id
FROM
    users AS a
JOIN
    usergames AS b
ON
    ( a.users_id = b.user_id )
GROUP
    BY users_id

see if it works , if not..post the table script so i'll be able to run some tests.

Bye


Messages In This Thread
How to get results from a joined query - by El Forum - 04-03-2009, 09:19 AM
How to get results from a joined query - by El Forum - 04-03-2009, 09:28 AM
How to get results from a joined query - by El Forum - 04-03-2009, 09:32 AM
How to get results from a joined query - by El Forum - 04-03-2009, 09:32 AM
How to get results from a joined query - by El Forum - 04-03-2009, 09:35 AM
How to get results from a joined query - by El Forum - 04-03-2009, 09:36 AM
How to get results from a joined query - by El Forum - 04-03-2009, 09:38 AM
How to get results from a joined query - by El Forum - 04-03-2009, 09:43 AM
How to get results from a joined query - by El Forum - 04-03-2009, 09:54 AM
How to get results from a joined query - by El Forum - 04-03-2009, 10:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB