Skip to content

Instantly share code, notes, and snippets.

@jcisio
Created November 23, 2017 11:26
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 jcisio/06aa0c02e61d6a693dcaee71ad2fb068 to your computer and use it in GitHub Desktop.
Save jcisio/06aa0c02e61d6a693dcaee71ad2fb068 to your computer and use it in GitHub Desktop.
Update nodes to the last revisions
UPDATE node
JOIN (SELECT nid, max(vid) as vid FROM node_revision GROUP BY nid) as tv USING(nid)
SET node.vid = tv.vid
WHERE node.type = 'cours'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment