Skip to content

Instantly share code, notes, and snippets.

@pandanote-info
Last active September 27, 2017 13:50
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 pandanote-info/1eea4d62e13cbfde8e38c6a56ce22735 to your computer and use it in GitHub Desktop.
Save pandanote-info/1eea4d62e13cbfde8e38c6a56ce22735 to your computer and use it in GitHub Desktop.
WordPressに記事として書かれている文章のおおよその総文字数を求めるSQL文
-- WordPressに記事として書かれている文章のおおよその総文字数を求めるSQL文
-- なお、本SQL文を利用することにより得られた結果については責任は負いかねます。
select sum(char_length(regexp_replace(regexp_replace(regexp_replace(post_content,'<.+?>',''),'&.+?;','_'),'(\s+|\r\n|\n)','')))
as total from wp_posts where post_status = 'publish' and post_type = 'post';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment