Created
June 12, 2021 21:35
-
-
Save bartubozkurt/1de270416a8389dca40234543a4d151a to your computer and use it in GitHub Desktop.
This SQL Server DELETE example would delete all records in the employees table where there is a record in the contacts table whose contact_id is less than 100, and the contact_id matches the employee_id
This file contains hidden or 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 employees | |
WHERE EXISTS | |
( SELECT * | |
FROM contacts | |
WHERE contacts.contact_id = employees.employee_id | |
AND contacts.contact_id < 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment