I want to fully overwrite a Redshift table.
In e.g. Hive, I could do the following:
INSERT OVERWRITE INTO target
SELECT s.* FROM staging s LEFT JOIN target t
ON s.primaryKey = t.primaryKey AND s.distKey = t.distKey
WHERE t.primaryKey IS NULL;
I don't get this to work in Redshift (other than dropping and re-creating the table).
Does anybody know what the Redshift syntax is for overwrite?