How do I analyse a string length and punctuation with SQL?

Need a quick re-cap of some of the text functions in SQL?

By using a combination of them, you can: 

  • count the number of words in a string
  • find if a string starts with a number
  • find if a string contains a particular punctuation sign
  • find if a string ends in a particular punctuation sign
  • find if a string ends with a number
  • count the number of characters in a string
  • count the number of Upper case characters in a string

Pretty powerful, no?

Check out the list below if you need a quick brush-up of the finer details behind each of these:

P.S. The example above works with Vertica and MySQL.

Want to check out some ready-made examples for other DBs?

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 )

Google+ photo

You are commenting using your Google+ 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.