Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Products per Order as a List

Return each order id with its products joined into one comma-separated string in alphabetical order. Order by order id.

Table schema

OrderItems(order_id INT, product VARCHAR(10))

Sample data

order_id | product
1 | Pen
1 | Book
2 | Bag
2 | Pen
2 | Cap

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.