Combine dupe records to one, where <> data becomes new field(s)
My brain seems to be having a tough time with this concept, although it really isn't that complicated. What I have is a 'membership' list (provided to us) and for some odd reason instead of having 3,4, or 5 columns exist for the different 'categories' each member may occupy, the table has ONE field for 'category' and in each case where a member has more than one 'category' desination there is a duplicate record, with only the 'category' being different.
On top of this anomoly, certain members have many locations - so names may repeat, but address or phone numbers might be different. I'll need to treat those as individual listings.
Normally we have one record for each member, and category fields in multiple within that record - like any sane person would do. What I can't seem to figure out is the correct sql or cf coding to combine the multiple (assumed same) members into one record while taking the unique/different categories (from the dupes) and simply adding them to the output of the base member data.
Example AS IS;
1, Bobs Lamps, lamp sales
2, Bobs Lamps, lamp repair
3, Bobs Lamps, Coconut Bikinis
Desired Output;
1, Bobs Lamps, lamp sales, lamp repair, Coconut Bikinis
If I can output a CSV list in the desired format I can re-import it generating the new columns. However not all listings will have multiple category occurances, so I'll need null placeholders for the potential 4 category columns.
I'm really hoping this is simpler than I can see at the moment, and one of you superstars can help a guy out!
Thanks in advance!
