t_machine Posted November 3, 2006 Share Posted November 3, 2006 hi, how would I group in a table but display the rest of the result for each.example:username | groupmembershipsam | 2jessica | 5sam | 7paul | 5how can i group username but display all the groupmembership that they are in? As you can see "sam" is in the table twice but in two different groupmembership.Thanks :) Link to comment https://forums.phpfreaks.com/topic/26073-group-by-with-multiple-results/ Share on other sites More sharing options...
gluck Posted November 4, 2006 Share Posted November 4, 2006 post the details of the table Link to comment https://forums.phpfreaks.com/topic/26073-group-by-with-multiple-results/#findComment-119378 Share on other sites More sharing options...
fenway Posted November 4, 2006 Share Posted November 4, 2006 That depends on what you want back -- you could use a GROUP_CONCAT(), or use a subquery to get the groups, and then pull back details. Link to comment https://forums.phpfreaks.com/topic/26073-group-by-with-multiple-results/#findComment-119409 Share on other sites More sharing options...
t_machine Posted November 5, 2006 Author Share Posted November 5, 2006 Thank you both :) Yeah, I decided to run a sub query to get back all the groups data. Link to comment https://forums.phpfreaks.com/topic/26073-group-by-with-multiple-results/#findComment-119975 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.