回答編集履歴

1

訂正

2019/06/28 12:13

投稿

sazi
sazi

スコア25188

test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  select name, count(*) cnt
8
8
 
9
- , array_to_string(array_agg(tag),',') tag_list
9
+ , array_to_string(array_agg(distinct tag order by tag),',') tag_list
10
10
 
11
11
  from TABLE_X
12
12
 
@@ -29,3 +29,5 @@
29
29
  ,(select tag_list from test where name='C') C_tag_list
30
30
 
31
31
  ```
32
+
33
+ ※パターンを集約せず列挙する場合は、distinctを外して下さい