SQL MAX scalar function in DB2 for i SQL |
MAX
The MAX function returns the maximum value in a set of values. We should pass at least 2 arguments.
Syntax
MAX(arg1, arg2, arg3, ...)
Example #1:
SELECT MAX(3,2,4,9,7,8) FROM SYSIBM.SYSDUMMY1
MAX 9
Example #2:
SELECT MAX(3,2,4,9,7,8,10.1, 11) FROM SYSIBM.SYSDUMMY1
MAX 11.0
Example #3:
SELECT MAX('a', 'b', 'c') FROM SYSIBM.SYSDUMMY1
MAX c
Example #4:
SELECT MAX('a', 'b', 'A') FROM SYSIBM.SYSDUMMY1
MAX A