Using the following tables:
products
product_id | name
1 | Jeans
2 | t-shirt
options
option_id | product_id | option_name | option_value
1 | 1 | size | 32
2 | 1 | colour | blue
3 | 1 | price | 100
4 | 2 | colour | red
I would like to run a query for a product and get back a single row containing the product data combined with the options for that product. The issue is the 1 to many relationship between the products and the options.
Is this possible in anyway maybe grouping them or having multiple columns in the result for each option?