Skip to content

Instantly share code, notes, and snippets.

@morganick
Created August 9, 2011 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morganick/1135516 to your computer and use it in GitHub Desktop.
Save morganick/1135516 to your computer and use it in GitHub Desktop.
Bulk Update rows.. there has to be a faster way
UPDATE contacts SET primary_email_id = (
SELECT id FROM contact_emails
WHERE contact_id = contacts.id AND is_primary = 1
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment