Skip to content

Instantly share code, notes, and snippets.

@rupl
Created July 9, 2015 11:52
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 rupl/a30b8440360081828505 to your computer and use it in GitHub Desktop.
Save rupl/a30b8440360081828505 to your computer and use it in GitHub Desktop.
SQL to extract latest revision of body field out of Drupal 7
SELECT node.title, body.body_value
FROM node
LEFT JOIN node_revision ON node.vid = node_revision.vid
LEFT JOIN field_revision_body AS body ON node_revision.vid = body.revision_id;
-- WHERE node.type = 'whatever'
-- etc
@rupl
Copy link
Author

rupl commented Jul 9, 2015

⚠️ I offer no guarantee that this is accurate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment