Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save szeidler/15d5e9e5d7455f94905648a7642304ea to your computer and use it in GitHub Desktop.
Save szeidler/15d5e9e5d7455f94905648a7642304ea to your computer and use it in GitHub Desktop.
Show me Drupal nodes, that are revisioned, are unpublished now, but were published sometime in the history
SELECT GROUP_CONCAT(nr.status) as concat, n.* FROM node AS n INNER JOIN node_revision AS nr ON nr.nid = n.nid GROUP BY nr.nid HAVING n.status = 0 AND FIND_IN_SET('1', concat);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment