Skip to content

Instantly share code, notes, and snippets.

@jkatz
Created May 2, 2013 15:57
Show Gist options
  • Save jkatz/5503219 to your computer and use it in GitHub Desktop.
Save jkatz/5503219 to your computer and use it in GitHub Desktop.
WITH old_rows AS (
SELECT a, b, c
FROM update_me
WHERE blah = true
), new_rows AS (
UPDATE update_me
SET a = 4, b = 5, c = 6
FROM old_rows
WHERE blah = true
)
SELECT *
FROM old_rows;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment