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:
- checking the first position of a string within a string
- extracting a substring from another
- checking the length of a string
- replacing a string within a string
- the classics: left, mid, right
P.S. The example above works with Vertica and MySQL.
Want to check out some ready-made examples for other DBs?