Last active
September 27, 2017 13:50
-
-
Save pandanote-info/1eea4d62e13cbfde8e38c6a56ce22735 to your computer and use it in GitHub Desktop.
WordPressに記事として書かれている文章のおおよその総文字数を求めるSQL文
This file contains 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
-- 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