Created
January 10, 2017 16:41
-
-
Save krschmidt/b5cec4fb708a2386e936020e863b9d44 to your computer and use it in GitHub Desktop.
Counts occurances of non-breaking spaces in the body field of a Drupal site
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT f.entity_id, | |
f.bundle, | |
Sum(f.counts) c | |
FROM (SELECT entity_id, | |
bundle, | |
Format((Length(body_value) - Length(REPLACE(body_value, ' ', ''))) / Length(' '), 0) AS counts | |
FROM field_data_body) AS f | |
GROUP BY f.entity_id | |
ORDER BY c ASC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment