In the last tutorial we left off with the SUM(column) function. In this article we will cover the remaining Aggregate Functions and the Scalar Functions. We might even make some fat jokes, some mama jokes, and as always, some nerd jokes.
Scalar functions work against one value and return one value based on the input. Aggregate functions work on a bunch of data and return one result. I understand if you fell asleep during that; I did just writing it.
Here is a table of scalar functions.
What it does
Changes a field to Uppercase
Changes a field to lowercase
Extracts characters from a text field
Returns the length of a text field
Returns the position of a character in a field
Returns the left part of text
Returns the right part of text
Rounds a numeric field to a number of decimals
Gives the remainder in division
Returns the present system date
Formats a field
For date calculation
If you want make all the characters of a selected item uppercase, you can use the UCASE function, like so:
Select UCASE('darth ladel') from Employees;
This will return the following: DARTH LADEL
Likewise, you may also wish to force all of the characters to be lowercase.