I have this table in PostgreSQL:
id related
1 FT5G
2 FT5G
5 RT5G
16 B5
8 RT5G
I want to group by related
and then get in one column list of all it's id
s.
Expected result is:
related ids
FT5G 1,2
RT5G 5,8
B5 16
I know it should be:
select ?
from tabl
group by related
This will give the groups, but I don't know how to specify the id
s in list for each group.