SQL functions and SQL Functions
SQL has many built-in functions for counting and computing.
SQL Aggregate Function
The SQL Aggregate function calculates the value obtained from the column and returns a single value.
Useful Aggregate functions:
- AVG ()-returns the average value.
- COUNT ()-number of returned rows
- FIRST ()-returns the value of the FIRST record
- LAST ()-returns the value of the LAST record
- MAX ()-returns the maximum value.
- MIN ()-returns the minimum value.
- SUM ()-return SUM
- Group by-GROUP
- HAVING
SQL Scalar functions
The SQL Scalar function returns a single value based on the input value.
Useful Scalar functions:
- UCASE ()-converts a field to uppercase
- LCASE ()-converts a field to lowercase
- MID ()-extract characters from a text field
- LEN ()-returns the length of a text field
- ROUND ()-rounds a numeric field to a specified number of decimal places.
- NOW ()-returns the current system date and time
- FORMAT ()-FORMAT the display mode of a field