回答編集履歴
1
追記
test
CHANGED
@@ -23,3 +23,23 @@
|
|
23
23
|
> END;
|
24
24
|
|
25
25
|
> $$ LANGUAGE plpgsql;
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
追記
|
30
|
+
|
31
|
+
--
|
32
|
+
|
33
|
+
質問のSQL自体は、以下の様に簡潔に記述できます。
|
34
|
+
|
35
|
+
```SQL
|
36
|
+
|
37
|
+
select id, data->>'key1' as key1, data->>'key2' as key2 from test1
|
38
|
+
|
39
|
+
except all
|
40
|
+
|
41
|
+
select id, key1, key2 from test2
|
42
|
+
|
43
|
+
order by id
|
44
|
+
|
45
|
+
```
|