Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: dhrobertsonHi all,
essentially I need to do the following:
I have a bunch of meetings where different products were discussed. 1 meeting could have had 3 products discussed and in the table I have, that is represented by 3 rows of the same meetingID followed by the name of the product in each case. what I want to get to is 1 row of data with 1 instance of the meetingID and each product listed on the same row. one meeting will not always discuss the same number of products.
I'm assuming I will need to do some sort of loop with a Do While of something like that but not sure the best way of doing it...
this is some dummy code to highlight what I'm trying to achieve:
input:
meetingID:string, Product:string
meeting1,honda
meeting1,ford
meeting1,mazda
meeting2,toyota
meeting2,honda
meeting3,mercedes
meeting4,mazda
meeting4,ford
meeting4,toyota
the output I'm looking for is:
MeetingID Product1 product 2 product 3
meeting1 Honda ford mazda
meeting2 Toyota Honda null
meeting3 Mercedes null null
meeting4 mazda ford Toyota
thanks for the help guys!
regards
douglas