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 … Continue reading How do I analyse a string length and punctuation with SQL?
It was pretty cool that the substring() function had the exact same syntax in all SQL Server, MySQL and PostgreSQL Are there more functions like that? Check out the ones below! replace() = replaces one part of a string with another ltrim() = removes leading spaces from a string rtrim() = removes trailing spaces from a string have … Continue reading How do I replace a string in SQL and make sure it has no extra spaces?
It's quite simple if you're using MySQL or PostgreSQL - the function you need in both is simply - length() There are a couple of points you'd better keep in mind if you're using SQL Server, however. 1. The function in that environment is called len() 2. Unlike length in the other two database systems, … Continue reading How do I determine the length of a string with SQL?