Skip to content

Instantly share code, notes, and snippets.

@ilmari
Created June 12, 2012 14:34
Show Gist options
  • Save ilmari/2917905 to your computer and use it in GitHub Desktop.
Save ilmari/2917905 to your computer and use it in GitHub Desktop.
UPDATE node_items
SET payload = $5
FROM nodes
JOIN users ON (users.user_id = nodes.node_id)
JOIN hosts ON (hosts.host_id = users.host_id)
WHERE
hosts.name = $1 AND
users.id = $2 AND
nodes.name = $3 AND
node_items.node_id = nodes.id AND
node_items.user_id = users.id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment