Apache Presto - Arithmetic Operator


Advertisements

Following sample queries are an example of arithmetic operators.

Query 1

presto:default> select 4 + 5 as addition;

Result

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

From the above result “as” is used for alias for the query.

Query 2

presto:default> select 4.5-3.5 as sub; 

Result

 sub 
----- 
 1.0 
(1 row) 

The output is subtraction between two values.

Query 3

presto:default> select 4 % 2 as modulus;

Result

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

The output is returned as the modulus for given values.

apache_presto_basic_sql_operations.htm

Useful Video Courses


Video

Apache Spark Online Training

46 Lectures 3.5 hours

Arnab Chakraborty

Video

Apache Spark with Scala - Hands On with Big Data

23 Lectures 1.5 hours

Mukund Kumar Mishra

Video

Learn Apache Cordova using Visual Studio 2015 & Command line

16 Lectures 1 hours

Nilay Mehta

Video

Delta Lake with Apache Spark using Scala

52 Lectures 1.5 hours

Bigdata Engineer

Video

Apache Zeppelin - Big Data Visualization Tool

14 Lectures 1 hours

Bigdata Engineer

Video

Olympic Games Analytics Project in Apache Spark for Beginner

23 Lectures 1 hours

Bigdata Engineer

Advertisements