1

I have a table like

Product Name     Option Type     Option Value
A                Color           Red
A                Color           Green
A                Size            M
A                Size            L

Now I need to get a list of all possible option combinations, i.e.

Product Name     Options              
A                Color: Red, Size: M
A                Color: Red, Size: L
A                Color: Green, Size: M
A                Color: Green, Size: L

Is that doable in MySQL?

jaktrip
  • 31
  • 3
  • What have you tried so far? Read [this](https://stackoverflow.com/help/how-to-ask) this before asking. – Marko Juvančič Aug 14 '17 at 17:09
  • I have tried to join the data with itself to get a result like color, then all sizes, then next color, then all sizes. But that did not work out. I thought maybe pivoting the options into individual columns helps but as I don't know which options there are (user configurable) I didn't get far with this either. – jaktrip Aug 14 '17 at 18:04

0 Answers0