Skip to content

Instantly share code, notes, and snippets.

@ccarrasc
Created February 19, 2014 19:06
Show Gist options
  • Save ccarrasc/9099237 to your computer and use it in GitHub Desktop.
Save ccarrasc/9099237 to your computer and use it in GitHub Desktop.
(MS) SQL example to copy a row in a table and replace the value in a specific column
INSERT INTO table (c1, c2, c3)
(SELECT 'new c1', c2, c3
FROM table
WHERE c1 = 'old c1')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment