sql server – Need to create an SQL result suitable for data mining

I have a database of supermarket transactions that I wish to use for associative data mining purposes. Below is an image of my current SQL query however I am not sure if what I require is possible with SQL (Explained below image).

Current SQL Result

I need my results to be in the following format – Each unique ProductName needs to have its own column with a binary 0/1 representation of whether the CustomerID purchased the product.

Required format

Is this possible? If so where exactly would I start?