Functions are called to perform a calculation and return a value. Functions must be invoked with no space between the function name and the parenthesis following it:

NOW()                    Correct
NOW ()                   Incorrect

If you pass multiple arguments to a function, arguments must be separated by commas. Spaces are allowed around function arguments:

CONCAT("abc","def")      This is okay
CONCAT( "abc" , "def")  This is okay, too

Comparison Functions

  • GREATEST( expr1,expr2,… )

    Returns the largest argument, where "largest" is defined according to the following rules:

    • If the function is called in an integer context or all the arguments are integers, the arguments are compared as integers.

    • If the function is called in a floating-point context or all the arguments ...

Get MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.