Skip navigation

Here’s a quick and dirty way to get the word count of a column with space separated text. The below code counts the number of words in the description column of the article table.

select length(description) - length(replace(description, ' ', ''))+1
from article

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.