Logical functions - GREATEST
This function returns the maximum value from a list of one or more expressions. -- syntax: GREATEST ( expression1 [ , ...expressionN ] ) Arguments: expression1, expressionN A list of comma-separated expressions of any comparable data type. The GREATEST function requires at least one argument and supports no more than 254 arguments. Each expression can be a constant, variable, column name or function, and any combination of arithmetic, bitwise, and string operators. Aggregate functions and scalar subqueries are permitted. Return types: Returns the data type with the highest precedence from the set of types passed to the function. If all arguments have the same data type and the type is supported for comparison, GREATEST returns that type. Otherwise, the function will implicitly convert all arguments to the data type of the highest precedence before comparison and use this type as the return type. For numeric types, the scale of the return type will be the sam...