Skip to content

Instantly share code, notes, and snippets.

@odahcam
Created August 1, 2018 23:40
Show Gist options
  • Save odahcam/94abbef618fa6cc5b32ba676aa18023c to your computer and use it in GitHub Desktop.
Save odahcam/94abbef618fa6cc5b32ba676aa18023c to your computer and use it in GitHub Desktop.
Delete from T1 using LEFT JOIN conditions in MySQL
DELETE p FROM persistences AS p
LEFT JOIN users AS u
ON u.id = p.user_id
WHERE u.id IS NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment