Skip to content

Instantly share code, notes, and snippets.

@eculver
Created February 22, 2010 20:02
Show Gist options
  • Save eculver/311432 to your computer and use it in GitHub Desktop.
Save eculver/311432 to your computer and use it in GitHub Desktop.
MySQL select word count
SELECT SUM(LENGTH(name) - LENGTH(REPLACE(name, ' ', ''))+1) FROM table
@davidsommer
Copy link

Nice but won't work for "Word1 Word2 Word3 "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment