I need to delete data from a table using a correlated sub-query. I'm having an issue with aliasing the table which has the data I want purged.
Code: Select all
dbadmin=> DELETE FROM store_location_dim sld WHERE NOT EXISTS (SELECT NULL FROM store_location_ext_dim sled WHERE sled.loc_id = sld.loc_id);
ERROR 4856: Syntax error at or near "sld" at character 32
LINE 1: DELETE FROM store_location_dim sld WHERE NOT EXISTS (SELECT ...
^
dbadmin=>