SQL UCASE() Function
The UCASE() Function
The UCASE() function converts the value of a field to uppercase.
SQL UCASE() Example
We have the following "Persons" table:
Now we want to select the content of the "LastName" and "FirstName" columns above, and convert the "LastName" column to uppercase.
We use the following SELECT statement:
SQL LCASE() Function
The LCASE() Function
The LCASE() function converts the value of a field to lowercase.
SQL LCASE() Syntax
SQL LCASE() Example
We have the following "Persons" table:
Now we want to select the content of the "LastName" and "FirstName" columns above, and convert the "LastName" column to lowercase.
We use the following SELECT statement:
SQL MID() Function
The MID() Function
The MID() function is used to extract characters from a text field.
SQL MID() Example
We have the following "Persons" table:
Now we want to extract the first four characters of the "City" column above.
We use the following SELECT statement:
SQL LEN() Function
The LEN() Function
The LEN() function returns the length of the value in a text field.
SQL LEN() Example
We have the following "Persons" table:
Now we want to select the length of the values in the "Address" column above. We use the following SELECT statement:
SQL ROUND() Function
The ROUND() Function
The ROUND() function is used to round a numeric field to the number of decimals specified.
SQL ROUND() Example
We have the following "Products" table:
Now we want to display the product name and the price rounded to the nearest integer. We use the following SELECT statement:
The result-set will look like this:
Comments
Post a Comment