By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TEMPORARY TABLE Yourtable (part_no varchar(100), store varchar(100));
insert into Yourtable values ('123','store a'),('123','store b'),('456','store b'),('456','store c'),('999','store c');
SELECT part_no, GROUP_CONCAT(store) as stores
from Yourtable
group by part_no;
drop table Yourtable;
part_no | stores |
---|---|
123 | store a,store b |
456 | store b,store c |
999 | store c |