I do have this kind of data in a table:
----------------------------------------
| price | category | categoryID |
----------------------------------------
| 50,100,150 | Pants | 1 |
----------------------------------------
| 30,60,90 | Polo | 2 |
----------------------------------------
Then I want to put them in separate rows that would look like this:
----------------------------------------
| price | category | categoryID |
----------------------------------------
| 50 | Pants | 1 |
----------------------------------------
| 100 | Pants | 1 |
----------------------------------------
| 150 | Pants | 1 |
----------------------------------------
| 30 | Polo | 2 |
----------------------------------------
| 60 | Polo | 2 |
----------------------------------------
| 90 | Polo | 2 |
----------------------------------------
How can I possibly do this in MS SQL? I'm currently trying the XML path but I can't do it with multiple columns.
Thank you.