I need to get all values from table product , EXCEPT they exits in 2 other table products. Is this query acceptable using 2 EXCEPTS ? Should this be done differently .
CREATE table missing_values
AS
select post
from product
EXCEPT
select post
from product_table_a
EXCEPT
select post
from product_table_b
;
A
- B
- C
is the same as A
- (B
+ c
):
SELECT post
FROM product
EXCEPT
(
SELECT post
FROM product_table_a
UNION ALL
SELECT post
FROM product_table_b
) AS sum;