Created
December 23, 2019 09:01
-
-
Save michalkortas/2bc988ee6554119ea464fc811fabc1e0 to your computer and use it in GitHub Desktop.
delete from table with references
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete from files | |
where files.file_id | |
in ( | |
select file_id from (select * from files) as removed_files left join addresses on removed_files.addresses_id = addresses.id | |
where addresses.id is null | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment