Apache-presto-arithmetic-operator

提供:Dev Guides
2020年6月22日 (月) 22:41時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

Apache Presto-算術演算子

次のサンプルクエリは、算術演算子の例です。

クエリ1

presto:default> select 4 + 5 as addition;

結果

 addition
----------
   9
(1 row)

上記の結果から、クエリのエイリアスとして「as」が使用されます。

クエリ2

presto:default> select 4.5-3.5 as sub;

結果

 sub
-----
 1.0
(1 row)

出力は、2つの値の間の減算です。

クエリ3

presto:default> select 4 % 2 as modulus;

結果

 modulus
---------
   0
(1 row)

出力は、指定された値のモジュラスとして返されます。