I have a table in MySQL that needs to be grouped. I am retrieving sales order with multiple items ordered
My current database query looks like this:
As you can see, sales order 255 has 2 items bought while sales order 300 has 3 items bought
Problem: I need to concatenate all product_id and their prices in line_items field or column according to their order_id
The Output that I am desiring for is this:
This is the query that i used:
SELECT bsb.ORDER_ID AS order_id, bsb.PRODUCT_ID AS product_id, bsb.PRICE AS product_price, '' AS line_items
FROM bsb
INNER JOIN bso ON bso.ID = bsb. ORDER_ID
WHERE bsb.ORDER_ID in(255, 300)
Kindly Please help me...