📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

MULTIPLY



The MULTIPLY function performs multiplication between two numbers. It is equivalent to using the * operator.

Syntax

MULTIPLY(x, y) -- Or using the operator syntax x * y

Arguments

ArgumentsDescription
x, yNumeric expressions to multiply together.

Return Type

Returns a numeric value with the appropriate data type based on the input arguments.

Examples

-- Using the function syntax SELECT MULTIPLY(5, 3); +----------------+ | MULTIPLY(5, 3) | +----------------+ | 15 | +----------------+ -- Using the operator syntax SELECT 5 * 3; +-------+ | 5 * 3 | +-------+ | 15 | +-------+ -- With decimal numbers SELECT MULTIPLY(2.5, 4); +------------------+ | MULTIPLY(2.5, 4) | +------------------+ | 10.0 | +------------------+ -- With column references SELECT number, MULTIPLY(number, 10) AS multiplied FROM numbers(5); +--------+------------+ | number | multiplied | +--------+------------+ | 0 | 0 | | 1 | 10 | | 2 | 20 | | 3 | 30 | | 4 | 40 | +--------+------------+

See Also

Was this page helpful?