Combing Rows
Posted: Wed May 10, 2006 8:25 pm
I have searched through several pages and have not found a solution to my problem:
For simplicity's sake, I have a table with 4 fields:
What I want is if the name id duplicated, combine the rows, so:
would be the result.
I have been trying to use:
'SELECT name, GROUP_CONCAT( stat1, stat2) FROM DAVE GROUP BY name'
But have not had any luck. Anyone have some insight on how I can accomplish this?
Any help is greatly appreciated!
Dave
For simplicity's sake, I have a table with 4 fields:
Code: Select all
id name stat1 stat2
-- -------- ------- -------
1 Dave 23 0
2 Larry 12 0
3 Dave 0 4
4 Larry 0 18Code: Select all
id name stat1 stat2
-- -------- ------- -------
1 Dave 23 4
2 Larry 12 18I have been trying to use:
'SELECT name, GROUP_CONCAT( stat1, stat2) FROM DAVE GROUP BY name'
But have not had any luck. Anyone have some insight on how I can accomplish this?
Any help is greatly appreciated!
Dave