teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

コメント追記

2018/06/06 09:39

投稿

sazi
sazi

スコア25430

answer CHANGED
@@ -1,5 +1,7 @@
1
1
  配列との結合は配列用の演算子を用いることができます。
2
2
  [9.18. 配列関数と演算子](https://www.postgresql.jp/document/10/html/functions-array.html)
3
+
4
+ ※withの部分はデータの代わりに記述しているので、実際には必要ありません。
3
5
  ```SQL
4
6
  with
5
7
  ユーザ as (

1

推敲 表現統一

2018/06/06 09:39

投稿

sazi
sazi

スコア25430

answer CHANGED
@@ -3,7 +3,7 @@
3
3
  ```SQL
4
4
  with
5
5
  ユーザ as (
6
- select 1::int as id, 'sato'::text as name ,array[1,2]::integer[] as groupid
6
+ select 1::int as id, 'sato'::text as name ,'{1,2}'::integer[] as groupid
7
7
  union all select 2,'tanaka','{2,3}'
8
8
  union all select 3,'yamada','{1,2,3}'
9
9
  union all select 4,'suzuki','{}'