In SQL Server, you can convert any lowercase string to uppercase by using the UPPER()
function.
To use it, simply pass the string as an argument when calling the function.
In SQL Server, you can convert any lowercase string to uppercase by using the UPPER()
function.
To use it, simply pass the string as an argument when calling the function.
In SQL Server, you can convert any uppercase string to lowercase by using the LOWER()
function.
Simply provide the string as an argument when you call the function, and it will be returned in lowercase form.
In MySQL, you can use the LOWER()
function to convert any uppercase characters to lowercase. Alternatively, you can use the LCASE()
function, which is a synonym for LOWER()
.
The syntax goes like this:
LOWER(str)
Or…
LCASE(str)
Where str
is the string you want converted to lowercase.
In MySQL, you can use the UPPER()
function to convert any lowercase characters to uppercase. Alternatively, you can use the UCASE()
function, which is a synonym for UPPER()
.
The syntax goes like this:
UPPER(str)
Or…
UCASE(str)
Where str
is the string you want converted to uppercase.
If you ever find yourself wanting only the first part of a string, or the last part of it, this article might help.
This article is specific to SQL Server, but the functionality is pretty common across most/all database management systems, not to mention most programming languages.
When working with SQL Server, you can use theT-SQL LEFT()
and RIGHT()
functions to return any given number of characters from the left or right of a string.
When working with MySQL databases, you might occasionally find yourself needing to select only a certain number of characters from the left or right of a string. In such cases, you can use the LEFT()
and RIGHT()
functions to do just that.
Here’s the syntax for both of these functions:
LEFT(str,len) RIGHT(str,len)
Where str
is the string that contains the substring you need to return, and len
is the number of characters from the left you want returned.
If you ever need to reverse the order of a string value in MySQL – that is, return a string with the order of the characters reversed – the REVERSE()
function is what you need.
Starting from SQL Server 2008, the REVERSE()
function can be used to reverse the order of a string. That is, it returns the characters in the string in reverse order.
Here’s the syntax:
REVERSE ( string_expression )
Where string_expression
is an expression of a string or binary data type. It can be a constant, variable, or column of either character or binary data.
MySQL has a TRIM()
function that enables you to remove leading and/or trailing whitespace from a string.
You can also use it to remove other specified characters from either side (or both sides) of the string.
This article explains how to remove specified leading/trailing characters from the string.
MySQL has a TRIM()
function that enables you to remove leading and/or trailing whitespace from a string.
You can also use it to remove other specified characters from either side (or both sides) of the string.
This article focuses on removing whitespace from both sides of the string.