Apache Presto - Logical Operator


Advertisements

Logical operators work on Boolean operands and produce Boolean results. Let’s take a few examples to see how logical operators work in Presto −

Query 1

select 3 < 2 and 4 > 1 as logical; 

Result

logical 
--------- 
 false 

Here, 4 > 1 is false so “AND” operator returns the result as false.

Query 2

presto:default> select 3 < 2 or 4 > 1 as logical;

Result

logical 
--------- 
 true 
(1 row) 

Both conditions are true, hence the result is true.

Query 3

presto:default> select 3 not in (1,2) as not_operator; 

Result

 not_operator 
-------------- 
 true 
(1 row)

Here, 3 value is not in the given set (1,2) hence it produces true result.

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