I have a table where it has Size and Price for each product. There could be multiple sizes with prices. I want to read size and price with ":" separated while each size:price is separated by commas for each product.
If I read it using SQL query I get the following.
PRODUCT_ID SIZE PRICE
001 L 20
001 S 15
002 M 10
002 L 20
002 S 5
I want to read the following as follows :
PRODUCT SIZE_PRICE
001 L:20,S:15
002 M:10,L:20,S:5
What is the best way to do this ?