Skip to Content
Presto实战
book

Presto实战

by Matt Fuller, Manfred Moser, Martin Traverso
March 2021
Intermediate to advanced
265 pages
6h 50m
Chinese
Posts & Telecom Press
Content preview from Presto实战
高级
SQL
特性
153
9-3:数学运算符
运 算 符 描  述 示  例
+
SELECT 1+1
-
SELECT 2-1
*
SELECT 2*3
/
SELECT 9/2
%
取模
SELECT 6 % 5
9-4:常用数学函数
函  数 返回类型 描  述 示  例
abs(
x
)
同输入
x
的绝对值
SELECT abs(-1)
cbrt(
x
) DOUBLE
x
的立方根
SELECT cbrt(9)
ceiling(
x
)
同输入
x
向上取最接近的整数
SELECT ceiling(4.2)
degrees(
x
) DOUBLE
x
角从弧度转换为角度
SELECT degrees(1.047)
exp(
x
) DOUBLE
e
(自然对数的底)的
x
次方
SELECT exp(1)
floor(
x
)
同输入
x
向下取最接近的整数
SELECT floor(4.2)
ln(
x
) DOUBLE
x
的自然对数
SELECT ln(exp(1))
log(
b
,
x
) DOUBLE
x
的以
b
为底的对数
SELECT log(2, 64)
log2(
x
) DOUBLE
x
的以
2
为底的对数
SELECT log2(64)
log10(
x
) DOUBLE
x
的以
10
为底的对数
SELECT log10(140)
mod(
n
,
m
)
同输入 取模,相当于
n
%
m
SELECT mod(3, 2)
power(
x
,
p
) DOUBLE
x
p
次方
SELECT pow(2, 6)
radians(
x
) DOUBLE
x
从角度转换为弧度
SELECT radians(60)
round( ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
Google系统架构解密: 构建安全可靠的系统

Google系统架构解密: 构建安全可靠的系统

Heather Adkins, Betsy Beyer, Paul Blankinship, Piotr Lewandowski, Ana Oprea, Adam Stubblefield

Publisher Resources

ISBN: 9787115560056