-
- postgres=#select*frombook2;
- id|name|tag
- ----+------+-----
- 1|java|aa
- 1|java|bb
- 1|java|cc
- 2|C++|dd
- 2|C++|ee
- (5rows)
- @H_404_62@string_agg(字段名,分隔符)
-
- selectname,string_agg(tag,',')frombook2groupbyname;
- name|string_agg
- ------+------------
- C++|dd,ee
- java|aa,bb,cc
- (2rows)