bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL GREATEST() Function

Concept visual

MySQL GREATEST() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Return the greatest value of the list of arguments:

SELECT GREATEST(3, 12, 34, 8, 25);

Definition and Usage

The GREATEST() function returns the greatest value of the list of arguments.

Note:

See also the LEAST() function.

Syntax

Greatest(

arg1, arg2, arg3, ...)

Parameter Values

Parameter

Description arg1, arg2, arg3, ... Required. The list of arguments to be evaluated

Technical Details

Works in:

From MySQL 4.0

More Examples

Example

Return the greatest value of the list of arguments:

SELECT GREATEST("w3Schools.com", "microsoft.com", "apple.com");

Previous

❮ MySQL Functions

Next

Previous

MySQL FLOOR() Function

Next

MySQL LEAST() Function