MySQL ATAN Function

Example

Return the arc tangent of a number:

SELECT ATAN(2.5);

Definition and Usage

The ATAN() function returns the arc tangent of one or two numbers. Continue reading MySQL ATAN Function

MySQL ASIN Function

Example

Return the arc sine of a number:

SELECT ASIN(0.25);

Definition and Usage

The ASIN() function returns the arc sine of a number.

The specified number must be between -1 to 1, otherwise this function returns NULL. Continue reading MySQL ASIN Function

MySQL ACOS Function

Example

Return the arc cosine of a number:

SELECT ACOS(0.25);

Definition and Usage

The ACOS() function returns the arc cosine of a number.

The specified number must be between -1 to 1, otherwise this function returns NULL. Continue reading MySQL ACOS Function

MySQL ABS Function

Example

Return the absolute value of a number:

SELECT ABS(-243.5);

Definition and Usage

The ABS() function returns the absolute (positive) value of a number.

Syntax

ABS(number)

Continue reading MySQL ABS Function

MySQL UPPER Function

Example

Convert the text to upper-case:

SELECT UPPER("SQL Tutorial is FUN!");

Definition and Usage

The UPPER() function converts a string to upper-case.

Note: This function is equal to the UCASE() function. Continue reading MySQL UPPER Function

MySQL UCASE Function

Example

Convert the text to upper-case:

SELECT UCASE("SQL Tutorial is FUN!");

Definition and Usage

The UCASE() function converts a string to upper-case.

Note: This function is equal to the UPPER() function. Continue reading MySQL UCASE Function

MySQL TRIM Function

Example

Remove leading and trailing spaces from a string:

SELECT TRIM('    SQL Tutorial    ') AS TrimmedString;

Definition and Usage

The TRIM() function removes leading and trailing spaces from a string. Continue reading MySQL TRIM Function

MySQL SUBSTRING_INDEX Function

Example

Return a substring of a string before a specified number of delimiter occurs:

SELECT SUBSTRING_INDEX("www.iampsp.com", ".", 1);

Definition and Usage

The SUBSTRING_INDEX() function returns a substring of a string before a specified number of delimiter occurs. Continue reading MySQL SUBSTRING_INDEX Function

MySQL SUBSTRING Function

Example

Extract a substring from a string (start at position 1, extract 3 characters):

SELECT SUBSTRING("SQL Tutorial", 1, 3) AS ExtractString;

Definition and Usage

The SUBSTRING() function extracts a substring from a string (starting at any position). Continue reading MySQL SUBSTRING Function

MySQL SUBSTR Function

Example

Extract a substring from a string (start at position 5, extract 3 characters):

SELECT SUBSTR("SQL Tutorial", 5, 3) AS ExtractString;

Definition and Usage

The SUBSTR() function extracts a substring from a string (starting at any position). Continue reading MySQL SUBSTR Function