I am trying to perform a fairly simple function in SQL - commonly known as comma delimited function or 'Text to Columns'. I have the output that I would like, now I just need to format it differently.
Currently I have the following output:
Transaction No_ Description
100 Apples, Oranges, Beets
101 Milk Chocolate, Potato Chips
102 Ground Beef, Herbs, Vegetable Stock
103 Bananas, White Bread
104 Nutella
I'm looking to get the same output but with Description column separated into multiple columns using the ','. Since I am dealing with transactional data, there is no limit on how many description items will be present in that col. Therefore the query must count the highest # of 'words' in the description col and add that many cols. to the output. Basically I'm trying to get a Sparse Matrix to input into another application (R).
Your help will be much appreciated.
Grazi!