The LAST() returns the last value of the selected column. Syntax:- SELECT LAST(column_name) FROM table_name; OR SELECT column_name FROM table_name ORDER BY column_name DESC LIMIT 1;...
The MAX() function returns the largest value of the selected column. Syntax:- SELECT MAX(column_name) FROM table_name; Example:- The subsequent SQL gets the largest value of the...
The MIN() function returns the smallest value of the selected column. Syntax:- SELECT MIN(column_name) FROM table_name; Example:- The subsequent SQL gets the value of the “Price”...
The SUM() returns the sum of a numeric column. Syntax:- SELECT SUM(column_name) FROM table_name; Example:- The subsequent SQL finds the sum of all the “Visits” fields...
The GROUP BY is used in conjunction with the aggregate functions to group the result-set by columns. Syntax:- SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator...
The HAVING was added to SQL because the WHERE keyword cannot be used with aggregate functions. Syntax:- SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name operator value...
The UCASE() converts the value of a field to uppercase. Syntax:- SELECT UCASE(column_name) FROM table_name; Example:- The subsequent SQL selects the “VisitorName” and “City” columns from...
The LCASE() converts the value of a field to lowercase. Syntax:- SELECT LCASE(column_name) FROM table_name; Example:- The subsequent SQL selects the “VisitorName” and “City” columns from...
The MID() is used to extract characters from a text field. Syntax:- SELECT MID(column_name,start,length) AS some_name FROM table_name; Example:- The subsequent SQL selects the first three...
The LEN() returns the length of the value in a text field. SQL LEN() Syntax:- SELECT LEN(column_name) FROM table_name; SQL LEN() Example:- The subsequent SQL selects...
The ROUND() is used to round a numeric to the number of decimals specified. SQL ROUND() Syntax:- SELECT ROUND(column_name,decimals) FROM table_name; SQL ROUND() Example:- The subsequent...