Skip to content

Instantly share code, notes, and snippets.

@jameswilson
Created November 21, 2014 18:03
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 jameswilson/94b40755d6ea638490d1 to your computer and use it in GitHub Desktop.
Save jameswilson/94b40755d6ea638490d1 to your computer and use it in GitHub Desktop.
Drupal Node Count by Type
# Tested with Drupal 6 and Drupal 7.
SELECT
COUNT(node.nid) AS count,
node_type.type AS type
FROM
node_type
LEFT JOIN
node ON node.type = node_type.type
GROUP BY
node.type
ORDER BY
count DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment