select id, productid, optionid
from tableA
where productid = 1
result (id, productid, optionid)
1 1 1
2 1 2
3 1 5
I would like the result to be (productid, optionids):
1 1,2,5
Naturally, I would think the query below should produce the above result
select productid, optionid
from tableA
group by productid
But what function do I put optionid in?