How do I use `WHERE NOT EXISTS`?
I am trying to write the followng where condition:
But Im not sure how to approach it.
But Im not sure how to approach it.
INSERT INTO Filing (location_id, filing_date, other_columns)
SELECT L.location_id, '2023-01-01'::date, default_values_for_other_columns
FROM Location L
WHERE NOT EXISTS (
SELECT 1
FROM Filing F
WHERE F.location_id = L.location_id
AND F.filing_date = '2023-01-01'::date
);