Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
create table Products (CategoryID int, ProductName varchar(255))
insert into Products
select 1, 'Milk'
union
select 1, 'Cream'
union
select 1, 'Yogurt'
SELECT STRING_AGG(ProductName,',') as list_of_products
FROM Products
WHERE (CategoryID = 1)