By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
declare @Yourtable table (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, string_agg(store,',') as stores
from @Yourtable t
group by part_no;
part_no | stores |
---|---|
123 | store a,store b |
456 | store b,store c |
999 | store c |