集合演算の注意点 重複行の扱い UNIONやINTERSECTをそのまま使用すると、重複行が排除される 以下の、samplesテーブルと、sampless2テーブルがあったとして、 postgres=# SELECT * FROM samples; col_1 | col_2 -------+------- 1 | 50 2 | 51 (2 rows) postgres=# SELECT * FROM samples2; col_1 | col_2 -------+------- 2 | 51 3 | 100 4 | 50 (3 rows) postgres=# SELECT * FROM samples UNION SELECT * FROM samples2; col_1 | col_2 -------+------- 4 | 50 2 | 51 1 | 50 3 | 100 (4 r