I have a table like this
records columnA columnB columnC columnD gary 2011 0 a gary 2011 0 b gary 2010 1 a mary 2011 0 a mary 2010 1 b mary 2010 1 c
i want to parse the table and if i find multiple lines where columnA columnB columnC are common to display the values from these three columns once followed by values found on columnD from each records where those columns A B C where the same.
Something like this
print output gary 2011 0 a,b gary 2010 1 a mary 2011 0 a mary 2010 1 b,c
I am using mysql, I tried with distinct but it duplicates the prints when found similar A B C columns. for example instead of displaying
gary 2011 0 a,b
once, it will disaply this line twice and so on three, four … times, for each similar lines found…
Thank you,
Mozley
You’re looking for
GROUP_CONCAT:Result
See the demo