📣
TiDB Cloud Premium 开放公测中。为企业级工作负载提供无限扩展、即时弹性伸缩和高级安全保障。此页面由 AI 自动翻译,英文原文请见此处。

MULTIPLY



MULTIPLY 函数对两个数字执行乘法运算。它等价于使用 * 运算符。

语法

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

参数

参数描述
x, y要相乘的数值表达式。

返回类型

根据输入参数,返回具有适当数据类型的数值。

示例

-- 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 | +--------+------------+

另请参阅

文档内容是否有帮助?